Code Formatters and Validators

Make code readable, or check that it is correct. The formatters take minified, inconsistently indented or machine-generated JavaScript, CSS and HTML and lay it out cleanly, or compress it for production. The validators parse a document and report what is wrong, where, and what the spec says instead.

Every Formatters & Validators tool

Formatting

The JavaScript, CSS and HTML formatters each offer the same two operations: beautify and minify. Beautify applies consistent indentation, line breaks and spacing, with the indent size and brace style as options; it is the fastest way to read a minified bundle or a stylesheet someone exported from a builder. Minify strips whitespace and comments to reduce file size for delivery. The tools do not rewrite logic or rename identifiers, so what comes out behaves exactly as what went in.

Validating markup

The HTML validator parses a document the way a browser does and lists structural problems — unclosed elements, misnested tags, duplicate IDs, attributes that do not exist on that element, missing alt and lang. The CSS validator reports unknown properties, invalid values and syntax errors with line numbers, and distinguishes real errors from vendor prefixes and newer properties it recognises. The SVG validator checks an SVG file's structure and attributes, flags elements and script that will not survive being used as an image, and points out the common export artefacts from design tools.

Validating strings

The URL validator parses an address into scheme, host, port, path, query and fragment, tells you whether it is well-formed and highlights the part that is not. The email validator checks an address against the actual syntax rules rather than a rough pattern, explains what failed, and optionally checks that the domain has mail records, since a syntactically perfect address for a domain with no MX record will still bounce.

Why in the browser

Code you are formatting is often unreleased, and markup you are validating often contains customer content. None of it is uploaded; parsing happens on your machine, apart from the optional MX lookup in the email validator, which sends only the domain name to a public resolver and nothing else.