# fn:count - XPath XQuery Reference

Returns the number of items in a sequence.deterministiccontext-independentfocus-independentThe function returns the number of items in the value of $arg.fn:count($seq1)2fn:count($seq3)0fn:count($seq2)3fn:count($seq2[. > 100])0fn:count([])1fn:count([1,2,3])1Returns 0 if $arg is the empty sequence.### Example in XMLSpy

[An example of the Count function used in XPath and XQuery](https://www.altova.com/images/xpath-count-example.png)

