XTools Logo
XTools
Blog
/
JSON Formatter & YAMLXML FormatterCode Formatter & MinifierJSON to TypeScriptMarkdown ⇄ HTMLMermaid Diagram EditorRegex TesterJWT DecoderUUID GeneratorEncode & DecodeCron Expression BuildercURL Command BuilderMeta Tag GeneratorPX to REM & Line HeightCSS GeneratorChmod Calculator

© 2026 XTools. All rights reserved.

Privacy PolicyContact Us

    Code Formatter & Minifier

    Format or minify HTML, CSS, JavaScript, TypeScript, and SQL
    • Files never leave your device
    • Runs in your browser
    • Free, no sign-up, no watermark
    1
    1

     

    Ctrl/⌘ + S downloads the result

    Format options

    Long lines are wrapped at this width where the language allows it.

    Related tools

    • JSON Formatter & YAML
    • XML Formatter
    • JSON to TypeScript
    • Markdown ⇄ HTML
    • Mermaid Diagram Editor
    • Regex Tester
    • JWT Decoder
    • UUID Generator
    • Encode & Decode
    • Cron Expression Builder
    • cURL Command Builder
    • Meta Tag Generator
    • PX to REM & Line Height
    • CSS Generator
    • Chmod Calculator

    How to use Code Formatter & Minifier

    Format or minify HTML, CSS, SCSS, Less, JavaScript, TypeScript, JSON, Markdown, YAML, and SQL in your browser. The language is detected automatically, and the result updates as you type.

    1. 1

      Paste code into Input, drop a file, or pick a language from Sample.

    2. 2

      Choose Format or Minify. The language menu shows what was detected; pick one yourself if it guessed wrong.

    3. 3

      Adjust Format options such as Indentation, Line width, Quotes, or SQL dialect, or Minify options such as Shorten variable names.

    4. 4

      Copy the output or click the download button. Ctrl/⌘ + S also downloads it.

    Frequently asked questions

    Is my code sent to a server?

    No. The formatters and minifiers (Prettier, sql-formatter, Terser, and CSSO) load into the page and run on your device, so your code stays in your browser.

    Which SQL dialects are supported?

    Standard SQL, MySQL, MariaDB, PostgreSQL, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Redshift, Spark SQL, Hive, Trino/Presto, DuckDB, ClickHouse, and IBM Db2. You can also set Keyword case to UPPER, lower, or As is.

    Why is Minify greyed out for TypeScript or Markdown?

    TypeScript needs compiling to JavaScript before it can be minified, and Markdown has nothing to minify, so those languages are formatted instead.

    Does minifying JavaScript rename my variables?

    Only if Shorten variable names is on. It renames local variables and functions; global names stay the same. Keep license comments preserves /*! and @license comments.

    Where does it show syntax errors?

    Below the editors, with the line and column when the parser reports them. The faulty line is also highlighted in the input.

    Are my settings remembered?

    Yes. Mode, language, and options are saved in this browser's local storage. Your code is not saved.