Ferramentas Guias
design Gratuito Sem cadastro

Visualizador de Caminho SVG

Cole um atributo `d` de caminho SVG, renderize-o ao vivo com uma grade e explore cada comando de caminho analisado.

Carregando ferramenta…

Sobre esta ferramenta

Insira qualquer string `d` de caminho SVG e veja-a renderizada instantaneamente em um canvas com fundo de grade. A ferramenta analisa todos os comandos — M, L, C, Q, A, Z, H, V, S, T — e os lista em uma tabela de análise com suas coordenadas. Use o controle deslizante de escala para ampliar e reduzir, escolha cores de traço e preenchimento, e ative ou desative o preenchimento. As dimensões da caixa delimitadora são calculadas e exibidas. Copie o caminho como um elemento SVG `<path d="..."/>` pronto para uso com um clique.

Como usar

  1. 1 Cole ou digite uma string `d` de caminho SVG no campo de entrada — um caminho de amostra é pré-carregado.
  2. 2 Ajuste o controle deslizante de escala e escolha cores de traço/preenchimento usando os seletores.
  3. 3 Revise a lista de comandos analisados abaixo do canvas para entender cada segmento.
  4. 4 Clique em 'Copiar como elemento SVG' para obter um snippet `<path d="..."/>` pronto para o seu código.

What an SVG path actually is

Every curve, icon, and complex shape in an SVG comes down to one attribute: d, the path data. It is a compact string of single-letter commands followed by numbers — a tiny drawing language where a virtual pen moves, draws lines, and sweeps curves across the canvas. The string M 20 80 C 40 10, 65 10, 95 80 tells the pen to move to (20, 80), then draw a cubic Bézier curve. This tool takes any such d string, renders it live on a grid, computes its bounding box, and lists every command in plain language so you can understand exactly what each segment does.

The command alphabet

Path commands come in pairs: an uppercase letter uses absolute coordinates (measured from the SVG origin), and the same lowercase letter uses relative coordinates (measured from wherever the pen currently sits). The tool parses and labels both.

CommandNameWhat it draws
M / mMove toLifts the pen and repositions it — no line drawn
L / lLine toStraight line to a point
H / h, V / vHorizontal / VerticalStraight line along one axis only
C / cCubic BézierCurve shaped by two control points
S / sSmooth cubicCubic that auto-mirrors the previous control point
Q / qQuadratic BézierCurve shaped by one control point
T / tSmooth quadraticQuadratic that auto-reflects the previous control point
A / aArcA segment of an ellipse
Z / zClose pathDraws a line back to the start

Understanding Bézier curves

The curve commands are where most people get lost, so it helps to see the difference. A quadratic Bézier (Q) has one control point: the curve starts at the pen, ends at the end point, and bends toward that single control point like a magnet pulling the line. A cubic Bézier (C) has two control points — one influencing the departure from the start, the other the approach to the end — which is why cubic curves can have an S-shape that quadratics cannot. The "smooth" variants (S and T) save you from repeating coordinates: they automatically reflect the previous control point so consecutive curves flow seamlessly, which is how long, wavy outlines are built without specifying every control point by hand.

A worked example

The pre-loaded sample is M 20 80 C 40 10, 65 10, 95 80 S 150 150, 180 80. Read it left to right: M 20 80 moves the pen to (20, 80). C 40 10, 65 10, 95 80 draws a cubic curve whose first control point is (40, 10), second is (65, 10), and end point is (95, 80) — both control points sit high above the baseline, so the curve arcs upward into a hill. Then S 150 150, 180 80 draws a smooth cubic: because it is an S, its first control point is automatically the reflection of the previous one across (95, 80), and you only supply the second control point (150, 150) and the end (180, 80). Those control points sit below the line, so this segment dips into a valley. The result is a smooth wave. The tool's command list spells all of this out, segment by segment, with the exact coordinates.

The bounding box and scale

After rendering, the tool reads the path's true bounding box via the browser's native getBBox() — the smallest rectangle (x, y, width, height) that contains the actual drawn geometry. This is genuinely useful: the numbers in a d string rarely tell you how big the shape ends up, especially once curves bulge past their control points. Knowing the real bounds lets you set a correct viewBox so the icon is not clipped or floating in empty space. The scale slider (0.25× to 4×) zooms the rendering so you can inspect a tiny detail or fit a large path into view, and it uses a non-scaling stroke so the outline stays a consistent visual weight at any zoom.

Use cases and tips

  • Learning by reverse-engineering. Paste a path copied from an icon set and watch the command list explain it — the fastest way to learn the path syntax.
  • Debugging a broken shape. If an SVG renders wrong, the parsed command list reveals a misplaced control point or a missing Z at a glance.
  • Sizing for production. Use the bounding box to derive an accurate viewBox and remove wasted padding.
  • Tip — keep coordinates small and clean. Paths built around a 0–100 or 0–24 grid are easier to read and edit than ones with long decimals.
  • Tip — prefer relative commands for reusable shapes. Lowercase commands let you reposition a whole path by changing only the initial M.
  • Pitfall — arcs are the hardest command. An A takes seven numbers including two flags (large-arc and sweep) that flip which of four possible ellipse segments is drawn; if an arc looks wrong, those flags are usually the cause.

Rendering, parsing, and the bounding-box calculation all happen in your browser. Nothing you paste is uploaded, and you can copy the result as a ready-to-use <path> element with one click.

Perguntas frequentes

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}