SVG Absolute to Relative Path Converter
Convert SVG paths between Absolute and Relative coordinates. Optimize file size, round decimals, and visualize changes instantly.
About
This tool transforms SVG path data between Absolute (uppercase) and Relative (lowercase) coordinates. While both render the exact same shape, they serve different engineering purposes. Absolute coordinates define points relative to the SVG origin 00, making them ideal for strict geometric transformations. Relative coordinates define points as a delta v from the previous position, often reducing file size for web optimization.
Mismanaged path data is a silent killer of render performance. Excessive decimal precision (e.g., 10.0000001) adds bloat without visual gain. This tool includes a precision engine to mathematically round values, ensuring your SVG code is as lightweight as possible while maintaining visual fidelity.
Formulas
The core transformation logic relies on vector addition. For a command converting from Relative to Absolute:
Where P represents the coordinate vector xy. Conversely, to find the Relative value from an Absolute target:
Special handling is applied to Smooth curves (S, T), where the first control point c1 is calculated as the reflection of the previous control point c2prev about the current point Pcurrent:
Reference Data
| Command | Name | Args | Description |
|---|---|---|---|
| M / m | Move To | x, y | Lift pen and start new subpath. |
| L / l | Line To | x, y | Draw straight line to point. |
| H / h | Horizontal | x | Draw horizontal line. |
| V / v | Vertical | y | Draw vertical line. |
| C / c | Cubic Bezier | x1,y1 x2,y2 x,y | Curve with two control points. |
| S / s | Smooth Cubic | x2,y2 x,y | Reflects previous control point. |
| Q / q | Quad Bezier | x1,y1 x,y | Curve with one control point. |
| T / t | Smooth Quad | x,y | Reflects previous control point. |
| A / a | Elliptical Arc | rx ry rot fA fS x y | Draws an arc. |
| Z / z | Close Path | - | Draws line back to start. |