Skip to content
PluginStats

Format HTML in PHP installs statistics

By rifi2k · VS Code Marketplace · Programming Languages

Provides formatting for the HTML code in PHP files using JSbeautify - Works well paired with a PHP formatting extension

View on VS Code Marketplace Fresh · Oct 20, 2026

Format HTML in PHP has 3,321,883 recorded installs on VS Code Marketplace, ranking #236 of 2,501 tracked listings.

Installs
3,321,883
Official API · Oct 20, 2026
7-day growth
—
Insufficient history
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#236
Among tracked VS Code Marketplace listings

Rating: 3.72 / 5 from 40 ratings

About Format HTML in PHP

<h1 align="center">Format HTML in PHP</h1> <h4 align="center">Formatting for the HTML code in PHP files.</h4>

This extension provides formatting for the HTML code in PHP files. This way this works is this extension runs right before the save action which triggers any other registered PHP formatting extensions so you are free to have one and this will not get in the way or block it.

Demo

Supported Features

  • Uses VSCode configurations for HTML formatting
  • Uses VSCode format on save setting
  • Custom keybinding for anytime formatting
  • Right click context menu option on PHP files
  • Command Palette option for formatting

There are multiple issues and Stackoverflow posts about not being able to format the HTML in PHP files and none of the solutions proposed anywhere really worked 100% so I decided to fix it.

Issues, Ideas, Feature Requests? Go ahead and add them. I'm down to help, add, or fix anything because I know this is badly needed for a lot of PHP / WordPress devs and was a major annoyance for me.

Feel free to have nested HTML in .php files now, it will format as you are expecting.


Using This Extension

Keybinding

CTRL + ALT + F

You can change this if desired through the standard Keyboard Shortcuts (File > Preferences > Keyboard Shortcuts) option screen the name is "Format HTML in PHP".

Context Menu

Within a PHP file you can right click and there is a menu option to Format HTML in PHP.

Format On Save

Turn on format on save either globally or scoped to PHP.

"editor.formatOnSave": false,
"[php]": {
  "editor.formatOnSave": true
}

HTML Settings

Here is the list of native vscode settings I pass to JS Beautify which control how your HTML will be formatted. You can change any of these to configure how the HTML will be formatted.

"editor.insertSpaces": true,
"editor.tabSize": 4,
"html.format.contentUnformatted": "pre,code,textarea",
"html.format.endWithNewline": false,
"html.format.extraLiners": "head, body, /html",
"html.format.indentHandlebars": false,
"html.format.indentInnerHtml": false,
"html.format.maxPreserveNewLines": null,
"html.format.preserveNewLines": true,
"html.format.wrapLineLength": 120,
"html.format.wrapAttributes": "auto",

Install

See the extension installation guide for details.


Release Notes

1.6.3
  • JS Beautify to stable 1.12.0
1.6.2
  • JS Beautify to stable 1.10.3
1.6.1
  • JS Beautify to stable 1.10.1
1.5.3
  • JS Beautify to stable 1.9.0
1.5.2
  • Documentation update about HTML settings - #17
  • JS Beautify bump to latest beta
1.5.0
  • Updating to the new JS Beautify version. If anyone notices any issues let me know!
  • Upstream fixes #14 - Don't format <?php tags
1.4.6
  • Don't add empty newline inside HTML script tags when html.format.endWithNewline is true.
1.4.4
  • Add HTML wrap attributes option.
  • README and instructions overhaul.
1.4.3
  • Hotfix - Saving a file without format on save enabled would replace all the code in the file with absolutly nothing. Oops...
1.4.1
  • Update README
1.4.0
  • Fixes #11 - Fixes the cursor jumping to the end of the file on formatting.
  • Fixes #8 - Adding workbench command for Format HTML in PHP.
  • Add right click menu option for Format HTML in PHP.
  • Add keybind Ctrl + Alt + F to format HTML in a PHP file.
1.3.8
  • Update code for checking on PHP scoped formatOnSave setting to use native vscode method.
1.3.7
  • Update README to be more clear about how formatOnSave settings should be configured.
1.3.6
  • Remove SVGs from README
1.3.5
  • Fixes #4 - Check for formatOnSave being set under the nested setting for just PHP files, and not just checking the main setting.
  • Fixes #5 - Duplicate of #4
1.3.4
  • Fixes #2 - Forgot about the fact when I switched to the save hook, it would run everytime no matter what. Duh.
1.3.2
  • Figured out the root cause was some of my defaults which I removed so I was able to add back in all the configurable fields again.
1.3.1
  • Had to remove a few options which were causing problems formating in certain situations.
1.3.0

Being a better neighbor!

  • Change from registering as a formatting provider (which languages can only have one active), to doing the work onBeforeSave. This way if users wanted to activate an extension that formatted the actual PHP we can all live in harmony. Most likely a formatting extension like phpcbf is going to register as a format provider so I proactively moved my work out of the way, because I'm always looking out and don't want a user to have to decide "which extension to keep".
1.2.0

Major refactor.

  • Added the ability for all of the HTML formatting settings as well as the editor settings for tabs vs spaces to be inherited and used by the formatter.
  • Gutted all the things that didn't need to be there.
  • Fixes #1
1.1.1

Initial release

Description from the VS Code Marketplace listing.

  • keybindings
  • php

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

Format HTML in PHP installs on VS Code Marketplace, last 90 days: 3,321,883 installs as of Oct 20, 2026.Format HTML in PHPInstalls on VS Code Marketplace · Last 90 days3,321,883installs3.3M3.3M3.3M3.3M3.3M3.3M3.3M3.3M3.3MJul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20installsobservedarchived (Internet Archive)no observationsOct 16, 2026 – Oct 20, 2026 · 5 observations · Updated Oct…pluginstats.com
Format HTML in PHP installs on VS Code Marketplace, last 90 days: 3,321,883 installs as of Oct 20, 2026.

7/30/90-day growth

Format HTML in PHP installs growth on VS Code Marketplace: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.Format HTML in PHPInstalls growth on VS Code Marketplace3,321,883installs now7-day growthinsufficient historyInsufficient history30-day growthinsufficient historyInsufficient history90-day growthinsufficient historyInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Oct 20, 2026pluginstats.com
Format HTML in PHP installs growth on VS Code Marketplace: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

Format HTML in PHP VS Code Marketplace ranking history: currently #236 (by installs).Format HTML in PHPVS Code Marketplace ranking · by installs · Last 90 days#236current rank#234#235#236#237#238Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 16, 2026 – Oct 20, 2026 · 5 observations · Updated Oct 20, 2026pluginstats.com
Format HTML in PHP VS Code Marketplace ranking history: currently #236 (by installs).

Ratings over time

Format HTML in PHP ratings on VS Code Marketplace, last 90 days: 40 ratings as of Oct 20, 2026.Format HTML in PHPRatings on VS Code Marketplace · Last 90 days40ratings3638404244Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20ratingsobservedarchived (Internet Archive)no observationsOct 16, 2026 – Oct 20, 2026 · 5 observations · Updated Oct…pluginstats.com
Format HTML in PHP ratings on VS Code Marketplace, last 90 days: 40 ratings as of Oct 20, 2026.

Listing placement

All VS Code Marketplace2,501 listings · 126 pages · 1,252 shown · page 12, #16 (overall #236)
All VS Code Marketplace: every listing in installs order

Listing placement

Programming Languages792 listings · 40 pages · page 5, #15 (overall #95)
Programming Languages: every listing in installs order

Listing placement

Formatters286 listings · 15 pages · page 2, #18 (overall #38)
Formatters: every listing in installs order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Installs on a linear scale. Placement is projected from installs, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (5)
Recent installs observations for Format HTML in PHP
Date (UTC)InstallsChange vs. previous
3,321,883+592
3,321,291+286
3,321,005+316
3,320,689+286
3,320,403—

Similar VS Code Marketplace Programming Languages plugins

All 20 Format HTML in PHP alternatives

Data source

Install counts, average rating, and rating counts come from the public Visual Studio Marketplace gallery API. Installs are cumulative and exclude updates.

Listing: https://marketplace.visualstudio.com/items?itemName=rifi2k.format-html-in-php. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.