tidy
Validate and reformat HTML markup
TLDR
Clean HTML file
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.
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).
