Sign up free

Code Formatter & Minifier

Use the online code formatter to format or minify HTML, CSS, JavaScript, SQL and XML as you type, turn JSON samples and curl commands into code, and get cron schedules, color codes and gradients right.

Code Formatter & Minifier: all 14 tools

HTML HTML FormatterIndent messy HTML so it’s easy to read.
JS JavaScript FormatterBeautify minified or messy JavaScript.
HEX Color ConverterConvert colors between HEX, RGB, HSL and CMYK, and check contrast.
CRON Cron Expression GeneratorBuild cron expressions and see the next run times in plain words.
CSS CSS FormatterTurn minified CSS into neat, readable rules.
CSS CSS MinifierMinify CSS to load faster.
HTML HTML MinifierShrink HTML by removing comments and extra whitespace.
HTTP HTTP Request TesterSend GET, POST and other requests to a public API and read the response.
JS JavaScript MinifierStrip comments and whitespace from JavaScript without changing how it runs.
JSON JSON to CodeTurn JSON into TypeScript, Java, Go, Python, C# or PHP classes.
SQL SQL FormatterFormat SQL queries with clean line breaks and indentation.
XML XML FormatterFormat and validate XML, with errors pointed out.
CSS CSS Gradient GeneratorDesign linear and radial gradients and copy the CSS.
CURL cURL to Code ConverterConvert cURL commands to Python, JavaScript, PHP, Go and more.

Format or minify HTML, CSS and JavaScript

Formatters turn one-line or messy code into indented code you can read and edit, and minifiers do the reverse before you publish. The HTML Formatter keeps inline tags in the text and leaves pre and textarea alone, while the HTML Minifier strips comments and whitespace and shows how much smaller the page got. The CSS Formatter indents nested @media rules, and the CSS Minifier keeps license comments and shortens colors like #ffffff to #fff. The JavaScript Formatter reads strings, template literals and regular expressions correctly, and the JavaScript Minifier removes only comments and whitespace.

SQL, XML and JSON

The SQL Formatter puts each clause and column on its own line for MySQL, PostgreSQL, SQL Server, Oracle and SQLite, with keywords in the case you pick. The XML Formatter checks sitemaps, RSS feeds, SVG and config files with your browser's XML parser and points to the line and column of any error. JSON to Code turns a JSON sample into TypeScript, Java, Go, Python, C#, PHP, Kotlin or Swift types.

APIs, cron jobs and colors

cURL to Code rewrites a curl command as Python, JavaScript, PHP, Go, Java or C#, and the HTTP Request Tester sends GET, POST and other requests to a public API and shows the status, headers and body. The Cron Expression Generator builds and explains schedules and lists the next 10 run times. The Color Converter moves between HEX, RGB, HSL, HSV and CMYK with WCAG contrast checks, and the CSS Gradient Generator writes linear, radial and conic gradients.

What runs where

Every tool on this page except the HTTP Request Tester runs entirely in your browser. Your code is never uploaded, there's no sign-up or daily limit, and the tools keep working offline once the page has loaded. The HTTP Request Tester sends your request from our server when you click, only to public addresses, and stores nothing. It doesn't use your daily tasks, though each visitor has an hourly allowance.

FAQ

Code Formatter & Minifier: questions and answers

What's the difference between formatting and minifying code?
Formatting adds line breaks and indentation so people can read the code. Minifying removes comments and whitespace so the file downloads faster. Edit the formatted version and publish the minified one.
Is my code uploaded to your server?
Only the HTTP Request Tester talks to our server, because it has to send your request from there, and it stores nothing. Every other tool runs in your browser, so code, queries and API samples stay on your device.
Will minifying break my JavaScript or CSS?
The minifiers only remove comments and whitespace and make safe shortenings such as #ffffff to #fff. The JavaScript Minifier keeps the line breaks that automatic semicolon insertion needs and doesn't rename variables. Check the page once after you swap the files.
Are these code tools free?
Yes, with no sign-up. The browser tools have no limit and work offline once loaded. The HTTP Request Tester doesn't use daily tasks either, but each visitor has an hourly allowance, higher for members and much higher for VIP.
Share Code Formatter & MinifierAll of these tools, one link.