HTML beautifier

    Indent and tidy messy or minified HTML code.

    Your text stays on this device

    About the HTML Beautifier tool

    This HTML beautifier re-indents HTML so nested tags are easy to follow, and also formats CSS inside <style> and JavaScript inside <script>. Paste minified page source, an email template or markup copied from a website builder, and choose 2 spaces, 4 spaces or tabs. It uses the js-beautify library and changes only whitespace between tags. It does not add missing closing tags, so an unclosed element shows up as indentation that never steps back. You can open .html files up to 20 MB.

    At a glance

    Indent
    2 spaces, 4 spaces or tabs
    Also formats
    CSS in <style> and JavaScript in <script>
    Method
    js-beautify; only whitespace between tags changes
    Output
    formatted.html; .html files up to 20 MB
    Price
    Free, no sign-up
    Works in
    Your browser, on phone or computer. Works offline after the first visit.
    Privacy
    What you type never leaves your device.

    How to beautify HTML

    1. Paste your HTML or open an .html file.
    2. Choose the indent size.
    3. Copy the formatted HTML or download it.

    Private

    Your text stays in your browser and is never sent to a server.

    Instant

    Results update as you type, with nothing to install.

    Free

    No sign-up, no limits and no ads inside your writing space.

    HTML Beautifier: frequently asked questions

    Will beautifying change how my page looks?

    Normally no. Only whitespace between tags changes. In rare cases whitespace between inline elements (like two <span>s) matters, so check text that must sit tightly together.

    Does it fix broken HTML?

    No. It formats what you give it and does not add missing closing tags. Unclosed tags usually show up as indentation that never steps back.

    Is there an HTML minifier?

    Not here: minifying HTML safely depends on <pre>, inline elements and scripts, so we left it out rather than risk breaking pages. For CSS, use the minify option in the CSS beautifier.

    Is my text sent anywhere?

    No. Everything runs in your browser and your text never leaves your device. Nothing is stored on any server.