Code Minify

This page groups seven minifiers that shrink technical files without changing their meaning. It includes JSON Minifier, XML minifier and HTML Minifier. Developers can prepare a release, trim an example or compare a compact output. These seven minifiers are free to use, need no account, and operate in the browser.

Start with the format you have: JSON Minifier for data, XML minifier for a markup document, HTML Minifier for a page. CSS Minifier and JavaScript Minifier target front-end assets, while GraphQL Minifier and SQL Minifier handle queries. If you need to read the content first, use a formatter before compacting it.

How to use

  1. For data, start with JSON Minifier or XML minifier to compact a document that is already valid.
  2. For a page or front-end assets, use HTML Minifier, then CSS Minifier and JavaScript Minifier according to the files.
  3. For a query, choose GraphQL Minifier or SQL Minifier and check that strings and structure stay intact.
  4. Before deploying, run JavaScript Minifier or CSS Minifier on a copy and check the expected behavior.

Frequently asked questions

Can minification break my file?

It removes whitespace and comments, but invalid content can still produce an unusable result. Always check the output before deploying it. For SQL or JavaScript, test the expected behavior in your context afterward.

Which minifier should I use for a GraphQL query?

Use GraphQL Minifier. It compresses a valid query while preserving its structure. If you need to read it first, go through GraphQL Formatter, then return to minification. That avoids compacting a query you have not understood.

Can I minify CSS and JavaScript separately?

Yes. CSS Minifier and JavaScript Minifier are separate tools. You can process each asset according to its own rules. This helps isolate an issue if a compact output does not behave as expected.

Can I minify a document without validating it first?

It is better to validate first. JSON Minifier and XML minifier expect correct content. If the document is invalid, HTML Minifier or CSS Minifier may produce output that is hard to fix. Review the content before compacting it.

How should I check SQL Minifier after use?

Use SQL Minifier on a copy, then review the resulting query and test it in your context. Check especially that strings are preserved. If any doubt remains, compare with the original version before running it.

Tools in the same category