Screenshot of the admin settings page for Beautifier plugins.
Before/After HTML source code a Drupal page.

Make your HTML source code pretty and/or compact.

The Beautify module buffers the HTML output of Drupal and processes it through a formatter - aka beautifier. Beautifiers are configurable and extensible plugin. You can create your own beautifier in your custom module too if you want.

Available beautifiers:
- Tidy (requires the Tidy PHP extension installed on your environment)
- HTML Beautify library (View the Github repo

How to install

  • Download the module
    composer require drupal/beautify
  • Enable the module
    drush en beautify
  • Go to admin page Admin > Config > Development > Beautifiers
  • Select the default beautifier, edit and save the configuration

Similar modules

Slack channel

Join the discussion on Slack in the #beautify channel. Details on how to connect to Drupal Slack here.


In memoriam of Richard Burford, original developer of this module whom company - Freestyle Systems - sponsored the development of the D5 and D6 versions.

Project information

Releases