Skip to content
toolsdocks

Format or minify your code

Paste code, pick the language, and format it for reading or minify it for production.

Runs on your device
Loading tool…

How to use

  1. Pick the language.
  2. Choose Format or Minify and options (indent, quotes, mangle).
  3. 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

InputHTML, CSS, JavaScript, TypeScript, JSON, Markdown
OutputFormatted or minified code
EnginePrettier 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

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.