Code Formatter
Format and beautify JavaScript, TypeScript, JSON, CSS, HTML, Markdown, YAML, XML and SQL, locally in your browser. No upload, no sign-up.
🔒 Your code stays in your browser. Nothing is uploaded.
What is Code Formatter?
Code Formatter beautifies source code and structured text in your browser. Pick a language, paste your code and press Format to get consistent indentation, spacing and line breaks. It runs on Prettier, the same formatter used by editors and CI pipelines, so the output matches what your toolchain would produce.
Everything runs locally: your code never leaves your device.
Supported languages
- JavaScript
- TypeScript
- JSON
- CSS
- HTML
- Markdown
- YAML
- XML
- SQL
Each language’s parser is downloaded only when you select it, so the page stays light.
When to use Code Formatter vs JSON Formatter
- Use JSON Formatter when you work specifically with JSON: it is the dedicated tool for that format, with indentation options.
- Use Code Formatter when you need one place to format several languages, or a language that has no dedicated tool here yet (CSS, HTML, Markdown, YAML, XML, SQL).
If you need to check that JSON is syntactically valid, use JSON Validator; if you need to compress it, use JSON Minifier.