Code formatter & minifier. Readable or tiny — locally.
Beautify or minify JSON, CSS, HTML and JavaScript on your device. Strict JSON parsing with exact error positions, conservative formatters that never rewrite your logic — nothing is uploaded.
A free online tool by Digital HeroesYour code never leaves your browser. Nothing is uploaded.
JSON uses a strict parser. CSS, HTML and JS use conservative formatters that preserve strings, comments and your code — they re-indent and normalize whitespace rather than rewriting syntax.
Formatting, without the toolchain
Sometimes you just need one config file readable or one snippet small — without installing Prettier, spinning up Node, or pasting proprietary code into a stranger's server. This formatter tokenizes your input first, so strings, template literals, regex and comments are never touched; only structure and whitespace change. JSON goes through the browser's strict parser, so errors come back with the exact line and column. Minifying shows the honest before → after byte count and percentage saved. Pick your indent, copy or download, done — no account, nothing uploaded, free forever.
Four languages, both directions.
- Beautify JSON with strict parsing and clear error messages showing the exact line and column.
- Format CSS into readable, properly indented blocks while preserving strings and comments.
- Prettify HTML with consistent indentation and correct handling of void tags and raw blocks (
script,style,pre,textarea). - Format JavaScript conservatively — strings, template literals, regex literals and comments are tokenized first and never altered.
- Minify any supported language and see the exact byte savings and percentage reduction in the status line.
- Choose your indent style — 2 spaces, 4 spaces or tabs — then copy or download the result instantly.
Four steps, no install.
- Select the language tab: JSON, CSS, HTML or JavaScript.
- Paste your code into the input panel, or click Load sample to try an example. The Tab key indents inside the editor.
- Pick an indent style and click Beautify — or click Minify to shrink it and see the byte savings.
- Copy or Download the result with the right file extension. Your code stays on your device the whole time.
Frequently asked questions.
Is the Code Formatter free?
Is it private? Is my code uploaded anywhere?
Will it change how my code behaves?
Why does my JSON fail to format?
How much smaller does minifying make my files?
Does it work offline?
Published · Last updated .