Nothing is uploaded
Formatting and minifying run in a Web Worker in this tab. Your source code never reaches AppCenter's servers.
Make messy HTML, CSS, JavaScript, TypeScript, JSON, XML, SQL, Markdown, YAML and more readable, or shrink HTML, CSS, JavaScript, JSON, XML and SQL. Your code is processed inside this browser tab and is not uploaded.
Press Tab inside the editor to insert an indent. The formatter never executes your code.
Lines longer than this wrap where the language allows it.
Ready
Formatting and minifying run in a Web Worker in this tab. Your source code never reaches AppCenter's servers.
Prettier, Terser and csso parse the code before printing it, so a comment marker inside a string is left alone.
A syntax error reports the line and column and leaves the editor untouched, so nothing is lost while you fix it.
Formatting changes whitespace and line breaks so code is easier to read, review and diff. It should never change behaviour: every statement, string and comment keeps its meaning.
Minification is the opposite trade. It removes comments and unnecessary whitespace to reduce transfer size. Use it for files you ship, and keep the formatted original in version control, because minified code is painful to review and to debug.
Input, written without consistent spacing:
const builds=[{id:1,target:"ios",status:"passed"},{id:2,target:"android",status:"failed"}];
function label(b){return b.target+": "+b.status}
console.log(builds.map(label).join(", "))
Output with JavaScript selected, 2-space indent, double quotes and semicolons:
const builds = [
{ id: 1, target: "ios", status: "passed" },
{ id: 2, target: "android", status: "failed" },
];
function label(b) {
return b.target + ": " + b.status;
}
console.log(builds.map(label).join(", "));
The same input through Minify becomes a single 181-byte line, down from 184 bytes before compression: object spacing, the redundant braces style and the trailing semicolon arrangement all collapse while the three statements stay separate and valid.
The Diff tab shows the identical rewrite line by line, with removed lines marked red and added lines green, so you can check a formatter change before committing it.
JavaScript has no required whitespace between many tokens, but it does depend on newlines in a few places and on whitespace inside strings, template literals and regular expressions. A script that strips spaces with a regular expression will happily break "a // b" or a regex literal.
This tool compiles JavaScript with Terser, so it parses the file into a syntax tree and prints a smaller but equivalent program. If the file does not parse, you get an error with the line and column instead of a mangled result.
CSS minification uses csso, which understands selectors, at-rules and custom properties. HTML, XML and SQL are handled conservatively: comments and indentation go, and then nothing else changes. Text inside <pre>, <textarea>, <script>, <style>, CDATA and quoted SQL strings is copied byte for byte.
| Language | Format | Minify |
|---|---|---|
| HTML, CSS, JavaScript, JSON, XML, SQL | Yes | Yes |
| TypeScript, JSX, TSX, SCSS, Less, Markdown, YAML, GraphQL | Yes | No |
Each editor accepts up to 5 MB of text. PHP, Swift, Kotlin and Dart are not offered here because no browser formatter for them has been verified, and showing an unreliable one would be worse than leaving it out.
TOP, LIMIT or backticked identifiers is dialect-dependent.Everything runs in a Web Worker started by this page, using libraries bundled with the site. No request carries your code, and the tool loads no third-party script at runtime. Closing the tab discards the worker and everything in it.
Local processing is a privacy feature, not a security review. Formatting does not look for malicious code, and minified output is still code you should read before you ship it.
It should not, and this tool only reformats parsed code. Behaviour can still differ if the original relied on automatic semicolon insertion in an unusual way, so review the diff before committing a bulk reformat.
Minifying TypeScript means stripping types first, and that is a compile step with its own decisions about decorators and module targets. Run your build tool for that, then minify the JavaScript output here.
Yes, Terser refuses to emit output it cannot parse. Only syntax that Terser supports is accepted, so very new proposals may be rejected with an error rather than mangled.
Yes. Open file reads the text in the browser, picks the language from the extension, and never sends the file anywhere. The 5 MB limit applies to the text, not to the name.
Yes, both format. Neither has a minifier here, because minifying JSX would require compiling it with your project's React or Preact settings.
To check structured data instead of reformatting it, use JSON & Data Studio; to encode values, use Encode & Decode; to compare two versions of a text document, use Text Studio.
References: the Prettier documentation for formatting options, the Terser and csso project documentation for minifier behaviour, and sql-formatter's dialect list for SQL keywords. Behaviour checked in current Chromium on 28 November 2026.
Use the Code Formatter to make a small change reviewable, distinguish formatting from minification, and check the result before replacing project code.
Development · 4 min read