Remove doctype (removeDoctype)
Removes the <!DOCTYPE svg> declaration. Browsers do not need it for inline SVG and it only adds bytes.
What Remove doctype does in SVGO
SVGO applies removeDoctype as part of its plugin pipeline. In SVGOMG the toggle is labeled Remove doctype (enabled by default). Optimization runs entirely in your browser — files are not uploaded to a server.
Use the SVGOMG optimizer with Show original to compare before and after. If output looks wrong, disable this plugin first, then re-enable related transforms one at a time.
When to enable
Production web assets and icons where the doctype provides no behavior.
When to disable
Workflows that require a full XML document with doctype for validation.
Watch out for
None for typical browser rendering.
Try it in SVGOMG
- Open svgomg.net and load your SVG (file, paste, or demo).
- Find Remove doctype in the Features panel (
removeDoctype). - Toggle the plugin and compare the preview; download when satisfied.
SVGO Plugin Guide
Browse the SVGO Plugin Guide or read the full SVG optimization walkthrough on the homepage.