Code formatters and testers

Format SQL, JavaScript, HTML, XML and CSS, convert cURL to code and HTML or SVG to JSX, optimise SVG, escape strings and test regular expressions.

Which tool to use

Formatting, minifying and beautifying

Formatting only changes whitespace and line breaks, so the code means the same afterwards. Minifying removes that whitespace, and usually comments, to cut bytes. Beautifying puts the layout back, but it cannot recover what a minifier threw away: shortened variable names stay short and comments do not return.

Privacy

Queries name your tables and source files can hold keys. All formatting here happens in the browser, so the code is not uploaded.

Frequently asked questions

What is the difference between minifying and beautifying code?
Minifying strips whitespace and comments to make a file smaller for delivery. Beautifying adds indentation and line breaks to make it readable. Neither changes what the code does.
Can a beautifier restore minified JavaScript to the original source?
Only the layout. Names that a minifier shortened and comments it removed are gone. Recovering the original needs a source map or the source itself.
Does formatting SQL change what the query does?
No. A formatter changes indentation, line breaks and keyword case. The statement the database receives is equivalent.
Which regular expression flavour does the Regex Tester use?
JavaScript. Patterns run on the browser's own RegExp engine, so syntax from PCRE, Python or .NET that JavaScript lacks will not work the same way.