SVG Validator: Check SVG for Errors and Get a Score

Validate an SVG against the most common problems and get plain-language fixes as you type.

SVG Validator tool

1Add your SVG

Drop your SVG here, or click to browse Or paste SVG code anywhere on the page. Nothing is uploaded.
No file?

2Adjust the options

3Preview and download

Live preview
sample.svg
Input and output codeView, edit and copy the code
Input SVG code
Output

Under the hood

How SVG Validator works

An SVG validator checks an SVG for the most common real-world problems and gives a score. It runs locally in your browser and explains each issue in plain language.

  1. <svg viewBox="0 0 400 300"><path d="M0 0 …"/>

    Parse as XML

    The SVG is parsed as strict XML. If it is not well-formed, the parser error is shown and the checks stop.

    DOMParser · image/svg+xml
  2. errorswarningsnotes

    Run structure checks

    The tool looks for a correct xmlns, a viewBox, a size, a title, duplicate ids and broken url(#…) references.

    Structure rules
  3. Run safety checks

    Scripts, inline event handlers and external resources are flagged because many platforms block them.

    Safety rules
  4. 100

    Score and explain

    Errors cost 30 points, warnings 10 and notes 2. Each issue is explained with how to fix it.

    Score ring
The four stages of the SVG Validator, from your input to the finished file.

What the validator checks

Errors
Invalid XML, wrong namespace, duplicate ids, broken references and invalid path data.
Warnings
Missing viewBox, inline event handlers, external resources and empty paths.
Notes
Missing size or title, and content before the svg tag.

Step by step

SVG Validator process

Four steps validate an SVG. Fix errors first, then warnings.

  1. Paste your SVG

    Drop a file or paste code. The sample is full of deliberate problems.

    Tip: Results appear as you type.

    Drop SVG
  2. Read the score

    The ring shows your score, and the label says Invalid, Valid with warnings or Valid SVG.

    Tip: Errors drop the score fastest.

    ErrorsWarningsNotes
  3. Fix the issues

    Work through the list. Use Format the code to make the markup easier to read.

    Tip: The score updates live.

  4. Copy the corrected code

    Copy or download your fixed SVG from the input box.

    Tip: Everything runs locally.

    Download SVGsvg-validator.svg

Use the SVG Validator

Reference

SVG Validator settings / conversion chart

The table lists each check, its severity and how to fix it. The chart shows the scoring weights.

Points deducted per issue

Points deducted per issueError: 30 pts; Warning: 10 pts; Note: 2 pts.Error30 ptsWarning10 ptsNote2 pts
The score starts at 100. Each error removes 30 points, each warning 10 and each note 2.

At a glance

  • Largest: Error.
  • Smallest: Note.

The score starts at 100. Each error removes 30 points, each warning 10 and each note 2.

SVG Validator checks, severity and fixes
CheckSeverityHow to fix
Not well-formed XMLErrorClose tags and quote attributes
Missing or wrong xmlnsErrorAdd xmlns="http://www.w3.org/2000/svg"
Duplicate idsErrorMake every id unique
Broken url(#id) referenceErrorAdd the missing element or remove the reference
Missing viewBoxWarningAdd a viewBox for scaling
Script or event handlerError or warningRemove it
No titleNoteAdd a <title> element

Answers

SVG Validator FAQ

Questions people ask about the SVG Validator, answered for this specific use case.

Is this an official W3C validator?

No. It checks the most common real-world problems locally in your browser. It is not a full schema validator.

What does the score mean?

It starts at 100 and drops by 30 per error, 10 per warning and 2 per note.

Why is a missing xmlns an error?

Without the SVG namespace, browsers may not treat the file as an SVG image.

Why are scripts flagged?

Many platforms block scripts in SVGs for security, so uploads may be rejected.

Are my files uploaded?

No. All checks run in your browser.

Ready to try it?

Your result is one drop away.

Open the SVG Validator

All converters

Every free converter and SVG tool

43 free tools that run in your browser. Pick a converter below, or search by format or task.