Code Formatter Tools
Beautify minified code, shrink a stylesheet or a script for production, check what a CSS selector actually matches, or move a query between MySQL, PostgreSQL and SQLite. Every parser here is written from the language specifications and runs in the page, so nothing you paste is uploaded and the tools keep working offline.
Most popular
- code-formattersHTML Formatter● ready
Indent block elements, keep inline markup on one line, and never reflow the contents of pre, textarea or style.
- code-formattersCSS Minifier● ready
Shrink a stylesheet safely: comments stripped, licence banners kept, empty rules dropped, 0px shortened to 0.
- code-formattersSQL Formatter● ready
A clause per line, items indented beneath it, AND/OR conditions on their own lines, keywords cased the way your team writes them.
- code-formattersJS Minifier● ready
Non-mangling minification with automatic-semicolon safety: 30–50% smaller, still debuggable, still the same program.
- code-formattersSpecificity Calculator● ready
Get the (a, b, c) triple for every selector, ranked highest first, with :is()/:not()/:where() handled the way the spec says.
Format & Minify
- code-formattersHTML Formatter● ready
Indent block elements, keep inline markup on one line, and never reflow the contents of pre, textarea or style.
- code-formattersHTML Minifier● ready
Collapse whitespace, drop comments and default attributes, unquote safe values — while protecting pre, textarea, script and style.
- code-formattersCSS Formatter● ready
One selector per line, one declaration per line, `property: value;` normalised — including nested media queries and CSS nesting.
- code-formattersCSS Minifier● ready
Shrink a stylesheet safely: comments stripped, licence banners kept, empty rules dropped, 0px shortened to 0.
- code-formattersJS Formatter● ready
Re-indent, space operators and break blocks — while keeping your line structure, template literals and regular expressions intact.
- code-formattersJS Minifier● ready
Non-mangling minification with automatic-semicolon safety: 30–50% smaller, still debuggable, still the same program.
- code-formattersTS Formatter● ready
The JavaScript beautifier with type syntax enabled, so `Array<string>` is not spaced like a comparison.
- code-formattersPython Formatter● ready
Convert tabs or 2-space indentation to 4 spaces, strip trailing whitespace, cap blank lines and tidy comma spacing.
- code-formattersShell Formatter● ready
One indent level per then/do/case/brace, heredocs preserved, plus warnings for unquoted expansions and unguarded commands.
- code-formattersGraphQL Formatter● ready
One selection per line, braces aligned, arguments inline or one per line — for queries, mutations, fragments and SDL.
SQL
- code-formattersSQL Formatter● ready
A clause per line, items indented beneath it, AND/OR conditions on their own lines, keywords cased the way your team writes them.
- code-formattersSQL Minifier● ready
Newlines and runs of spaces become single spaces, comments can be dropped, keywords optionally upper-cased — strings untouched.
- code-formattersSQL Dialect Converter● ready
Identifier quoting, auto-increment columns, LIMIT forms, IFNULL/COALESCE, GROUP_CONCAT/STRING_AGG — plus a list of what to check by hand.
CSS Analysis
- code-formattersSpecificity Calculator● ready
Get the (a, b, c) triple for every selector, ranked highest first, with :is()/:not()/:where() handled the way the spec says.
- code-formattersSelector Tester● ready
Every match with its full path, so a selector that hits three elements instead of one is obvious before you ship the CSS.
- code-formattersUnits Converter● ready
One value, every unit at once, with the context fields that make rem, em and % meaningful.
- code-formattersAutoprefixer● ready
Pick your targets, get the prefixed declarations in place — with an explicit list of what still needs a manual look.
- code-formattersCSS Reset● ready
Pick a stance — strip browser defaults, or correct the differences between engines — and copy the result.
Structure & Utilities
- code-formattersTag Validator● ready
Structural HTML checking: unclosed tags, stray end tags, void elements with end tags, duplicate attributes and implicit closes.
- code-formattersBoilerplate● ready
A correct, minimal HTML5 skeleton: charset first, escaped values, optional Open Graph and Twitter tags.
- code-formattersComment Stripper● ready
Comment removal that respects strings, template literals, regexes and URLs, so `https://…` survives and `#` in a colour does not.
- code-formattersString Escaper● ready
Quotes, backslashes, newlines and control characters handled per language — with the quote style you asked for.
- code-formattersLine Endings● ready
See CRLF, LF and CR counts, spot a mixed file instantly, and convert to the style your repository expects.
- code-formattersIndentation● ready
It detects the current style and width, then rewrites leading whitespace only — code, strings and trailing spaces stay untouched.
All tools
- code-formattersHTML Formatter● ready
Indent block elements, keep inline markup on one line, and never reflow the contents of pre, textarea or style.
- code-formattersHTML Minifier● ready
Collapse whitespace, drop comments and default attributes, unquote safe values — while protecting pre, textarea, script and style.
- code-formattersTag Validator● ready
Structural HTML checking: unclosed tags, stray end tags, void elements with end tags, duplicate attributes and implicit closes.
- code-formattersCSS Formatter● ready
One selector per line, one declaration per line, `property: value;` normalised — including nested media queries and CSS nesting.
- code-formattersCSS Minifier● ready
Shrink a stylesheet safely: comments stripped, licence banners kept, empty rules dropped, 0px shortened to 0.
- code-formattersSQL Formatter● ready
A clause per line, items indented beneath it, AND/OR conditions on their own lines, keywords cased the way your team writes them.
- code-formattersSQL Minifier● ready
Newlines and runs of spaces become single spaces, comments can be dropped, keywords optionally upper-cased — strings untouched.
- code-formattersSQL Dialect Converter● ready
Identifier quoting, auto-increment columns, LIMIT forms, IFNULL/COALESCE, GROUP_CONCAT/STRING_AGG — plus a list of what to check by hand.
- code-formattersJS Formatter● ready
Re-indent, space operators and break blocks — while keeping your line structure, template literals and regular expressions intact.
- code-formattersJS Minifier● ready
Non-mangling minification with automatic-semicolon safety: 30–50% smaller, still debuggable, still the same program.
- code-formattersTS Formatter● ready
The JavaScript beautifier with type syntax enabled, so `Array<string>` is not spaced like a comparison.
- code-formattersPython Formatter● ready
Convert tabs or 2-space indentation to 4 spaces, strip trailing whitespace, cap blank lines and tidy comma spacing.
- code-formattersShell Formatter● ready
One indent level per then/do/case/brace, heredocs preserved, plus warnings for unquoted expansions and unguarded commands.
- code-formattersGraphQL Formatter● ready
One selection per line, braces aligned, arguments inline or one per line — for queries, mutations, fragments and SDL.
- code-formattersSpecificity Calculator● ready
Get the (a, b, c) triple for every selector, ranked highest first, with :is()/:not()/:where() handled the way the spec says.
- code-formattersSelector Tester● ready
Every match with its full path, so a selector that hits three elements instead of one is obvious before you ship the CSS.
- code-formattersUnits Converter● ready
One value, every unit at once, with the context fields that make rem, em and % meaningful.
- code-formattersAutoprefixer● ready
Pick your targets, get the prefixed declarations in place — with an explicit list of what still needs a manual look.
- code-formattersCSS Reset● ready
Pick a stance — strip browser defaults, or correct the differences between engines — and copy the result.
- code-formattersBoilerplate● ready
A correct, minimal HTML5 skeleton: charset first, escaped values, optional Open Graph and Twitter tags.
- code-formattersComment Stripper● ready
Comment removal that respects strings, template literals, regexes and URLs, so `https://…` survives and `#` in a colour does not.
- code-formattersString Escaper● ready
Quotes, backslashes, newlines and control characters handled per language — with the quote style you asked for.
- code-formattersLine Endings● ready
See CRLF, LF and CR counts, spot a mixed file instantly, and convert to the style your repository expects.
- code-formattersIndentation● ready
It detects the current style and width, then rewrites leading whitespace only — code, strings and trailing spaces stay untouched.
About Code Formatter Tools
Reading code you did not write is most of the job: a minified bundle, a stylesheet from a template, a query inherited from another team. This category does that work locally — HTML, CSS, SQL, JavaScript, TypeScript, Python, shell and GraphQL are tokenized by hand-written parsers, so a format or a minify pass never touches a string literal, a template literal, a regular expression or a comment that was part of the data. Alongside the formatters are the analysers that answer the harder questions: which CSS selector matches this markup, how does the cascade score it, what does 1.5rem mean at this root size, which prefixes do the browsers you support still need, and what exactly is wrong with this HTML nesting. Nothing is uploaded, no code is evaluated, and every tool works with the network switched off.
Related categories
Frequently asked questions
What is a code formatter?
A formatter rewrites only the layout of a source file — indentation, line breaks, spacing and quoting — without changing what the code does. Minifiers do the opposite: they remove everything the compiler or browser does not need. Both are safe in a strict sense only if the tool understands the language, which is why these pages tokenize instead of pattern-matching.
Is it safe to paste proprietary code into these tools?
The code never leaves your browser: the tokenizers are plain TypeScript running in the page, there is no upload step and no network call. That said, the page is still a web page — if your policy forbids pasting code into websites at all, save the page and use it offline, where it behaves identically.
Why do these tools not use a real compiler or a library like Prettier?
Because a browser-first formatter should not need a build step, and because the honest behaviour matters more than the last few percent of canonical output. Hand-written tokenizers let each page state exactly what it does and does not change — for example that Python line wrapping or JSX reflow are outside scope — instead of quietly rewriting your source through a parser you cannot inspect.
Will minifying break my code?
These minifiers never rename identifiers, reorder statements or remove functions, so the risk is much lower than with a bundler-style minifier. The one genuine hazard is automatic semicolon insertion, which the JavaScript Minifier handles by keeping the newlines that matter (after return/throw/break/continue and before a token that could continue the statement). Re-run your tests against the minified file anyway.
Which SQL dialects and which languages are covered?
SQL formatter and dialect converter: MySQL, PostgreSQL and SQLite. Formatters: HTML, CSS, SQL, JavaScript, TypeScript, Python, shell (sh/bash/zsh) and GraphQL. Comment stripping adds the same set, and the escaping tool covers JavaScript, TypeScript, Python, Java, C#, Go, JSON, SQL and shell.