How to use
- Pick the language.
- Choose Format or Minify and options (indent, quotes, mangle).
- Copy or download; syntax errors show their location.
Worked example
function add (a,b){return a+b} formats to a four-line function and minifies to function add(n,d){return n+d}.
Supported formats and limits
| Input | HTML, CSS, JavaScript, TypeScript, JSON, Markdown |
|---|---|
| Output | Formatted or minified code |
| Engine | Prettier standalone; Terser; CSSO; HTML whitespace/comment minifier with embedded CSS/JS minification |
Limitations
- Minifying with mangling renames local variables; it never renames globals or properties.
- TypeScript and Markdown can be formatted but not minified.
Questions
How do I format HTML online?
Paste the HTML, choose HTML and format. Prettier re-indents the markup with your indent size and line width; a syntax error is reported with its location instead of producing broken output.
How do I beautify JavaScript?
Paste the code, choose JavaScript or TypeScript and format. Set indentation, quotes, semicolons and line width to match your project.
Which languages are supported?
Formatting with Prettier: HTML, CSS, JavaScript, TypeScript, JSON and Markdown. Minifying: JavaScript with Terser, CSS with CSSO, HTML (including its inline CSS and scripts) and JSON.
Can minifying break my code?
Terser renames local variables only when mangling is on and never renames globals or properties. Test minified code before deploying, especially code that relies on function names or eval.
What happens with a syntax error?
The error is shown with its line and column, and no output is produced until it is fixed.
Privacy
Runs on your device. Files and text are processed in this browser tab and are not uploaded.
See the privacy policy for how toolsdocks handles data.