Web Dev

HTML Minifier

Minify or beautify HTML code.

How to use it

  1. Open Devly from the wrench in your menu bar, or press ⌃⌥⌘D. Press ⌘P, type HTML Minifier and press Return.
  2. Choose Minify or Beautify at the top.
  3. Paste or type your text into Input.
  4. Adjust the Options on the right if you need to. The defaults are listed below.
  5. Press Minify, or ⌘↵.
  6. To go the other way, press Swap or ⌘S. The output moves into the input.
  7. Use Copy or ⇧⌘C to copy the result. ⌘L clears everything.

Options

OptionValuesDefault
Indent SpacesIndentation for beautify mode1–82
Remove commentsStrip HTML commentsOn or offOn
Collapse whitespaceRemove extra whitespaceOn or offOn

Example

Real output from Devly, with the default options.

Input
<!DOCTYPE html>
<html>
  <head>
    <title>Devly</title>
  </head>
  <body>
    <!-- main -->
    <h1>  Hello, Devly  </h1>
  </body>
</html>
<!DOCTYPE html><html><head><title>Devly</title></head><body><h1>Hello, Devly</h1></body></html>

From Terminal

With the free command-line tool installed:

Terminal
devly htmlminify --path input.txt
# or pipe text in
pbpaste | devly htmlminify

Quick Switch also finds it by: html, minify, beautify, compress, markup.

More Web Dev tools