Beautify or minify JavaScript, CSS, HTML, SQL, XML and JSON, and see the bytes
Everything here runs in your browser. Files are never uploaded.Formatting goes two ways and the two are opposites. Beautifying takes a minified or badly indented file and makes it readable, which is what you want when you are trying to understand something that arrived without whitespace. Minifying strips every byte that is not needed, which is what you want when the file is about to be served. Both directions are here for six languages, and neither sends your code anywhere.
JavaScript Beautifier, CSS Beautifier, HTML Formatter, SQL Formatter and XML Formatter all take a wall of text and give it back with structure. This is the tool for a stylesheet pulled off a live site, a query somebody pasted into a ticket on one line, or an API response that arrived as a single 40 KB string.
JSON Formatter is the one used most, and it goes further: it validates as well, and reports the line and column of the first error with a plain-English explanation of what is wrong.
Markdown Preview is the same idea for prose: write on the left, see the rendered result on the right, with tables, task lists and code blocks.
The minifiers report how many bytes went. That number is the honest one to judge by, and it is usually smaller than people expect for code that is already served with gzip or brotli: compression has already removed most of what whitespace costs. Minify because it is free, not because it will transform a page.
It changes whitespace, not meaning. A formatter cannot fix a bug, will not rename anything, and will not tell you that a stylesheet has four rules doing the same thing. Minifying HTML is the one case to watch, because whitespace inside a document is sometimes significant, and the tool leaves those cases alone rather than saving a byte and breaking a layout.
Pasting a file into a site that posts it to a server is a leak, and the file is often a production stylesheet, a query with table names in it, or a response with real customer data. Nothing on this page makes a network request with what you paste.
No. Every formatter and minifier here parses and rewrites your text in the browser, so a production stylesheet or a query containing real table names never leaves your machine.
A little. Most of the saving is already taken by gzip or brotli compression on the server, so minifying a well-compressed file typically buys a few per cent more rather than the fifty per cent the raw byte count suggests.
No. These tools change whitespace, indentation and line breaks. The one thing to check is minified HTML, where whitespace between inline elements can be visible, and the tool preserves those cases.
PostgreSQL, MySQL, SQL Server and several others. Pick the dialect so that quoting and dialect-specific keywords are formatted the way that database writes them.
Usually a trailing comma, a single quote where JSON requires a double, or an unquoted key. The error names the line and column of the first problem and what it expected there.
Several megabytes format in well under a second. The ceiling is your browser memory rather than a limit we set.