Replace one HTML tag with another in a full HTML document. Processing runs fully in your browser.
Limit replacement to specific elements (optional)
HTML: Tag Replacer - Explanation & Examples
The Tag Replacer tool replaces one HTML tag with another across a full HTML document.
You can optionally limit replacements by class name and/or ID, and choose whether to preserve attributes.
⭐ What this tool does
Replaces matching opening and closing tags correctly
Maintains inner content exactly as-is
Supports optional filters: class contains and ID equals
Supports self-closing tags such as <img />
🔎 Optional filters
If both filters are empty, all matching tags are replaced
If class filter is set, only elements whose class contains that value are replaced
If ID filter is set, only elements whose ID equals that value are replaced
If both are set, both conditions must match
⚙️ Attribute option
Preserve attributes checked: attributes are kept
Preserve attributes unchecked: attributes are removed from replaced tags