SVG ViewBox Calculator
Build a validated viewBox and report viewport scale factors.
- Free
- No sign-up
- Runs in your browser
- Nothing uploaded
Scope: This calculates viewBox source and independent scale factors; it does not render or inspect SVG markup.
Workbench
Inputs stay on this page. Press Ctrl or ⌘ + Enter to run.
How to use SVG ViewBox Calculator
Fill in the fields:
- Minimum x: -1,000,000 to 1,000,000.
- Minimum y: -1,000,000 to 1,000,000.
- Content width: 0.001 to 1,000,000.
- Content height: 0.001 to 1,000,000.
- Padding: 0 to 1,000,000.
- Viewport width: 0.001 to 1,000,000.
- Viewport height: 0.001 to 1,000,000.
- Preserve aspect ratio: Centre, meet, Top-left, meet, Bottom-right, meet, Centre, slice, None.
Press “Calculate viewBox”.
Copy the result, or download it as svg-viewbox.json.
About this tool
Build a validated viewBox and report viewport scale factors.
Produces source and arithmetic only. SVG is not executed or rendered.

