DEV Community

AEFRI for AEFRI

Posted on Originally published at aefristore.web.app

A tiny SVG stroke & viewBox inspector (offline, no upload)

A tiny SVG stroke & viewBox inspector (offline, no upload)

Icon files look simple until one renders at 16 px as a black blob, or scales wrong because it has a fixed width but no viewBox. I wanted a quick way to see what an SVG actually contains before shipping it, so I built a small inspector that runs entirely in the browser.

What it reports

  • viewBox, width, height — and a warning when the viewBox is missing.
  • Element counts — paths, circles/rects/lines/polygons/ellipses, groups.
  • Stroke and fill colours with counts, plus stroke-width values.
  • Inline <style> presence.
  • External <image>/<use> references that could break offline.
  • Previews at 16, 24, 32, 48 and 64 px, plus one light-background preview.

Nothing is uploaded: the file is read with the browser’s File API and parsed with DOMParser. No network calls, no account.

Try it

Why this exists

I sell CC0 icon sets, so “will this SVG behave at small sizes?” is a question buyers ask. The inspector answers the file-level facts (viewBox present? strokes or fills? fixed dimensions?) without pretending to validate SVG spec compliance or optimise the file. It’s a diagnostic, not a linter.

AI disclosure

I used AI assistance (an AI coding agent) to write this post and to help build the tool. The tool performs local file parsing and reporting; you can inspect the page source in your browser.

Top comments (0)