LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

tidy

Validate and reformat HTML markup

TLDR

Clean HTML file
$ tidy [input.html]
copy
Write to file
$ tidy -o [output.html] [input.html]
copy
Modify in place
$ tidy -m [file.html]
copy
Convert to XHTML
$ tidy -asxhtml [input.html]
copy
Show only errors
$ tidy -e [input.html]
copy
Indent output
$ tidy -i [input.html]
copy
Quiet mode
$ tidy -q [input.html]
copy
Wrap at column
$ tidy -w [80] [input.html]
copy

SYNOPSIS

tidy [-o output] [-m] [-i] [options] [files]

DESCRIPTION

tidy validates and reformats HTML documents, detecting markup errors such as missing closing tags, improper nesting, and deprecated elements. It can automatically fix many common problems while producing consistently formatted output with standardized indentation and line wrapping.The tool can convert HTML to XHTML (-asxhtml) for stricter XML-compliant output, or reformat in place with -m. Error-only mode (-e) reports problems without modifying the document, useful for quick validation checks. Output wrapping width is configurable with the -w flag.

PARAMETERS

-o FILE

Output file.
-m, --modify
Modify in place.
-i, --indent
Indent content.
-e, --errors
Show errors only.
-q, --quiet
Quiet mode.
-w N, --wrap N
Wrap at column.
-asxhtml
Output as XHTML.
-ashtml
Output as HTML.
--indent-spaces N
Spaces per indent.

INSTALL

sudo apt install tidy
copy
sudo dnf install tidy
copy
sudo pacman -S tidy
copy
sudo apk add tidyhtml
copy
sudo zypper install tidy
copy

CAVEATS

May change whitespace. Some fixes alter rendering. Complex pages need care.

HISTORY

HTML Tidy was originally developed by Dave Raggett at W3C. It's maintained by HTACG (HTML Tidy Advocacy Community Group).

SEE ALSO

xmllint(1), prettier(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid