SVG ツールキット
SVG を整形 / 圧縮 / 情報表示。
SVG ツールキットとは
SVG ツールキットは、SVG コードを 3 モードで処理する無料ツールです。Format は 2 スペースインデントで整形、Minify はコメントと余白を除去、Info は viewBox・width/height・サイズ・要素内訳を一覧表示します。テキスト要素の移植性に関する注意も表示されます。すべてブラウザ内で完結します。
🔒 処理はすべてブラウザ内で完結し、データは送信されません。
このツールの前提
- 処理場所
- このページのブラウザ内(JavaScript / Canvas)
- アップロード
- なし — ファイルは端末の外に出ません
- オフライン
- ページを開いた後は通信不要
It must have an <svg> root, and that check is the first filter
The tool refuses input without an <svg> element, which catches the common mistake of pasting the inner shapes only, or pasting an HTML fragment that merely contains an icon. A file that fails this check is not an SVG document regardless of its extension.
Once parsed, the operations are structural: tidy attributes, remove metadata and editor namespaces (inkscape:, sodipodi:), and optionally reduce coordinate precision. None of them rasterise the image, so nothing is lost to rounding at the pixel level — only in the numeric text.
Precision reduction is a visible trade
Rounding coordinates to two decimals shrinks the file noticeably on path-heavy artwork and is imperceptible on icons. On maps, charts or fine linework the same rounding produces visible wobble, because thousands of points shift by a fraction in the same direction.
Removing metadata is almost always safe; removing elements that look unused is not. A <defs> entry may be referenced by url(#id) from a style attribute, and a gradient that appears unused in the markup may be applied from an external stylesheet.
The classic rendering failures
A missing viewBox means the graphic will not scale — width and height pin it, and CSS resizing crops rather than shrinks. A viewBox with the wrong coordinate origin shifts everything off-canvas. Both are one-line fixes that are very hard to spot in code and obvious on screen.
Fill and stroke inheritance is the other one: shapes with no fill attribute inherit from CSS, so the same file can appear black on one page and invisible on another. If an icon disappears after embedding, check for a fill="currentColor" against a matching text colour before editing the paths.
使い方
- 1.SVG を貼り付け
- 2.Format / Minify / Info を選ぶ
- 3.実行して結果を確認
他の方法との比較
同じ変換をする方法は 3 つあります。ブラウザ内(このページ)、サーバー側の変換サービス、デスクトップアプリ。差がつくのは速度ではなく、ファイルがどこへ行くかと、無料でどこまでできるかです。
| 観点 | このツール | サーバー側の変換サービス | デスクトップアプリ |
|---|---|---|---|
| ファイルの処理場所 | このページのブラウザ内 | ベンダーのサーバー(アップロード後) | 自分の PC(アプリをインストール) |
| アカウント | 不要 | 多くの場合必要(無料枠の制限解除に登録を求める) | 不要(ライセンス認証は必要な場合あり) |
| 無料で扱えるサイズ | サイズ制限なし(回数制限もなし) | 数ファイル/時間、または 5〜10MB 程度で課金 wall | ディスクとメモリ次第 |
| 料金 | 無料。Pro は月 $9(大きいファイルと AI 機能のみ) | サブスクが一般的。おおむね月 $7〜15(2026 年 11 月時点) | 買い切り、またはサブスク |
| オフライン | 一度開けば通信不要 | 不可 | 可 |
| 20MB を処理し始めるまで | 待ち時間なし(アップロードが無い) | アップロードが支配的(10Mbps 上りで約 16 秒) | アプリの起動のみ |
| 保証できないこと | 不正な入力は「修復」せず、パーサのエラー位置を返します | 同じ(変換の原理は変わらない) | 同じ。ただし書式の再現はより忠実な場合がある |
サーバー側のサービスが優れている点は明確にあります。巨大なファイル、チームでの共有、変換履歴の管理、スクリプトからの自動化。逆に「1 回だけ、手元のファイルを別形式にしたい」という今回の用途では、アップロードの待ち時間と登録の手間だけが増えます。
よくある質問
Info モードで分かることは?
viewBox、width/height、ファイルサイズ、要素の種類ごとの個数、<text> の有無(フォント依存の移植性チェック)が分かります。
パスの最適化はできる?
パス座標の再計算はしません。コメント除去と空白圧縮のみの無破壊ミニファイです。
この変換で失われるもの
フォーマッタは入力を構文木に解析し、一貫したインデントで出力します。入力が不正なら、黙って壊れたファイルを返すのではなく、パーサのエラー位置を表示します。壊れた JSON は「修復」されず、そのまま壊れたまま示されます。