---
name: "hxcount"
section: "1"
platform: "linux"
package: "html-xml-utils"
version: "8.8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/hxcount"
---

# hxcount(1)

count elements and attributes in HTML or XML files

## NAME

hxcount - count elements and attributes in HTML or XML files

## SYNOPSIS

**hxcount** \[ *file-or-URL* \]

## DESCRIPTION

The **hxcount** command counts the number of elements and attributes of each type that appears in the input and prints a report on stdout.

## OPERANDS

The following operand is supported:

- *file-or-URL*

  The name or URL of an HTML or XML file. If absent, standard input is read instead.

## EXIT STATUS

The following exit values are returned:

- **0**

  Successful completion.

- **\> 0**

  An error occurred in the parsing of the HTML or XML file. **hxcount** will try to recover from the error and produce output anyway.

## ENVIRONMENT

To use a proxy to retrieve remote files, set the environment variables **http\_proxy** and **ftp\_proxy**. E.g., **http\_proxy="http://localhost:8080/"**

## BUGS

Don't trust the output if there were errors in the input.

Remote files (specified with a URL) are currently only supported for HTTP. Password-protected files or files that depend on HTTP "cookies" are not handled. (You can use tools such as [**curl**(1)](/curl/1.md) or [**wget**(1)](/wget/1.md) to retrieve such files.)

## SEE ALSO

[**asc2xml**(1)](/asc2xml/1.md), [**hxprune**(1)](/hxprune/1.md), [**hxnormalize**(1)](/hxnormalize/1.md), [**hxnum**(1)](/hxnum/1.md), [**hxtoc**(1)](/hxtoc/1.md), [**hxunent**(1)](/hxunent/1.md), [**xml2asc**(1)](/xml2asc/1.md), **UTF-8** (RFC 2279)
