Code Beautifier & Formatter
Turn minified or messy code into clean, consistently indented code with Prettier, right in your browser.
- Free & unlimited
- No sign-up
- Instant results
How to use Code Beautifier
- Paste your code or open a file; the language is detected for you.
- Pick indent, line width and JavaScript style options.
- Copy the formatted code or download it.
Powered by Prettier
This tool uses Prettier, the formatter used by millions of developers, so the output follows the same style as most modern projects. It supports HTML (with inline CSS and JS), CSS, SCSS, LESS, JavaScript and JSX, JSON, YAML and Markdown.
Unminify code
Paste a minified file (one long line) and get it back with line breaks and indentation, which makes it possible to read and debug. Comments and original names removed by minifiers can't be restored.
When formatting fails
Prettier only formats valid code. If it finds an error, you see the line and column so you can fix it. If detection picked the wrong language, choose it from the list.
Frequently asked questions
Is my code sent anywhere?
No. Prettier runs entirely in your browser.
Can it format TypeScript?
Not yet; use JavaScript mode for plain JS and JSX.
Why did my HTML spacing change?
Whitespace between tags is reformatted for readability; use the HTML Minifier for the smallest file.
Is it free?
Yes, with no limits.
Related tools
HTML Minifier
Shrink HTML, including inline CSS and JS.
CSS Minifier
Shrink CSS by removing comments and spaces.
JavaScript Minifier
Shrink JavaScript safely with a real parser.
JSON Formatter & Validator
Format, validate and minify JSON with clear error messages.
More Developer Tools
JSON to CSV Converter
Convert a JSON array to CSV for Excel or Google Sheets.
CSV to JSON Converter
Convert CSV or Excel data into a JSON array.
Base64 Encode & Decode
Encode text to Base64 or decode Base64, UTF-8 safe.
URL Encode & Decode
Percent-encode or decode URLs and split them into parts.
UUID Generator
Generate random v4 or time-ordered v7 UUIDs in bulk.
JWT Decoder
Decode a JSON Web Token and check when it expires.
Hash Generator
MD5, SHA-1, SHA-256 and SHA-512 hashes for text or files.
HTML Entity Encoder & Decoder
Escape < > & " for HTML, or decode & style entities.