[{"data":1,"prerenderedAt":28},["ShallowReactive",2],{"content-code-formatter-en":3},{"about":4,"steps":7,"faq":12},[5,6],"Code copied from a page source, an email template or a minified library is often a single long line or inconsistently indented. The formatter cleans it up with Prettier: HTML, CSS, SCSS, Less, JavaScript and TypeScript. XML is indented by a separate formatter that also checks that every tag is closed correctly.","The “Minify” mode goes the other way: JavaScript is compressed with Terser (shorter variable names, dead code removed), while CSS, HTML and XML lose comments and unneeded whitespace. The HTML minifier is deliberately careful: the content of pre and textarea stays untouched and spaces between inline elements are kept. Everything runs in your browser; your code is not uploaded.",[8,9,10,11],"Paste your code. The language is detected automatically, but you can also choose it yourself.","Choose “Format” and set indentation, line length and, for JavaScript\u002FTypeScript, semicolons and quotes.","Or choose “Minify” to shrink HTML, CSS, JavaScript or XML. Below the result you see how much smaller it is.","Copy the result or download it as a file.",[13,16,19,22,25],{"q":14,"a":15},"Which formatting rules are used?","For HTML, CSS, SCSS, Less, JavaScript and TypeScript, the default rules of Prettier, the most widely used code formatter. You can set the indentation (2 or 4 spaces or tabs), line length, semicolons and single quotes.",{"q":17,"a":18},"Why is my code not formatted?","The code has to be syntactically valid. On an error, the tool shows the line and column. Also check that the right language is selected, e.g. TypeScript instead of JavaScript when the code has type annotations.",{"q":20,"a":21},"Can I minify SCSS, Less or TypeScript?","No, these languages are normally compiled first. Minify the generated CSS or JavaScript instead. Formatting works for all seven languages.",{"q":23,"a":24},"Does minifying change how my page behaves?","The CSS, HTML and XML minifiers only remove comments and whitespace that have no effect. License comments starting with \u002F*! are kept. For JavaScript, Terser shortens local variable names and simplifies expressions; global names stay unchanged. Inline scripts with syntax errors are kept as they are by the HTML minifier.",{"q":26,"a":27},"Is there a formatter for JSON and SQL too?","Yes, format and validate JSON with the [[json-formatter]] and SQL with the [[sql-formatter]]. For Markdown, use the [[markdown-editor]].",1793707143983]