Skip to main content
NyankoTools

CSS/JS/HTML Minifier & Formatter

Paste CSS, JavaScript, or HTML code to have it automatically formatted for readability. Click "Minify" to shrink it for production. To work with JSON, try the JSON Formatter as well.

🔒 Runs in your browser · Your data is never sent to a server

Note: minifying CSS does not throw on invalid syntax — it may silently skip the affected part instead. If the result looks unexpected, check the formatted output first to confirm the syntax is valid. Minifying HTML only strips comments and collapses whitespace between tags — the contents of <style> and <script> tags are kept as-is (switch to the CSS or JavaScript language to minify those separately).

Notes

  • Formatting uses Prettier, and minifying uses csso for CSS and terser for JavaScript, chosen by the selected language. Make sure the language matches your code.
  • Minified output is hard to read, so always keep the original source. If a problem appears in production, investigate with the original code.
  • Your code is processed in the browser and is never sent to a server.

Glossary

Formatting

Rewriting code with consistent indentation and line breaks so it is easier for humans to read. This tool uses Prettier internally.

Minify

Stripping line breaks, indentation, and comments that are not needed at runtime to reduce a file's size, typically before shipping it to production.

FAQ

Does minifying change how the code behaves?

Minifying removes unneeded whitespace and comments. JavaScript is also compressed (for example, variable names are shortened) and normally behaves the same, while HTML loses whitespace between tags, which can change spacing between inline elements. Invalid syntax can produce unexpected output, so always test before deploying.

What is the difference between formatting and minifying?

Formatting adds indentation and line breaks to make code readable; minifying removes unnecessary characters to reduce file size. Use formatting while developing and minifying for delivery.

Is my code sent to a server?

No. Everything runs in your browser and your code is never uploaded, so it is safe to use with private code.

Share this page

↑↓ Select Enter Open Esc Close