Every horizontal video eventually has to become a vertical one. YouTube wants 16:9; Shorts, Reels and TikTok want 9:16. There are only three honest ways to make that conversion, and each one is a few lines of arithmetic. This post walks through the numbers and gives you two small functions that compute them.
Disclosure: I work on Skrrol AI, a browser-based video studio. The math below is tool-independent.
The uncomfortable number: 31.7%
Take a 1920×1080 source and a 1080×1920 target.
The target's aspect ratio is 9 ÷ 16 = 0.5625. The tallest 9:16 window that fits inside a 1080-pixel-high frame is 1080 × 0.5625 = 607.5, so about 608 pixels wide.
608 out of 1920 is 31.7% of the picture. A full-height vertical crop throws away more than two thirds of what you shot. That one number explains why naive conversions look bad: the subject only has to drift a little off-centre to leave the frame.
Option 1: crop
Cut a 608×1080 window out of the source and scale it up to 1080×1920. The picture fills the screen, but:
- you keep 31.7% of the width, and
- you upscale by 1080 ÷ 608 ≈ 1.78×, so a 1080p source looks soft. Starting from a 4K master (3840×2160) gives a 1215-pixel-wide window, which is enough for a clean 1080-wide vertical.
The only real decision is where the window sits. Centre is the default, but a window that follows the subject is nearly always better. Here is a function that takes a focus point (0 to 1 across the frame) and returns a window that never leaves the source:
// Largest window of the target aspect that fits inside the source. function cropWindow(srcW, srcH, targetW, targetH, focusX = 0.5, focusY = 0.5) { const targetAspect = targetW / targetH; const srcAspect = srcW / srcH; let w, h; if (srcAspect > targetAspect) { h = srcH; w = Math.round(srcH * targetAspect); } else { w = srcW; h = Math.round(srcW / targetAspect); } const x = Math.round(Math.min(Math.max(focusX * srcW - w / 2, 0), srcW - w)); const y = Math.round(Math.min(Math.max(focusY * srcH - h / 2, 0), srcH - h)); return { x, y, w, h }; } cropWindow(1920, 1080, 1080, 1920); // { x: 656, y: 0, w: 608, h: 1080 } cropWindow(1920, 1080, 1080, 1920, 0.3); // { x: 272, y: 0, w: 608, h: 1080 } subject left of centre cropWindow(1920, 1080, 1080, 1920, 0); // { x: 0, y: 0, w: 608, h: 1080 } clamped to the left edge With a canvas, the window maps straight onto drawImage:
const { x, y, w, h } = cropWindow(video.videoWidth, video.videoHeight, 1080, 1920, focusX); ctx.drawImage(video, x, y, w, h, 0, 0, 1080, 1920); Animate focusX over time and you have a reframe that follows the action.
Option 2: letterbox
Scale the whole frame down until it fits the target width and centre it.
// Whole source scaled to fit inside the target, centred. function letterbox(srcW, srcH, targetW, targetH) { const scale = Math.min(targetW / srcW, targetH / srcH); const w = Math.round(srcW * scale); const h = Math.round(srcH * scale); return { x: Math.round((targetW - w) / 2), y: Math.round((targetH - h) / 2), w, h, scale }; } letterbox(1920, 1080, 1080, 1920); // { x: 0, y: 656, w: 1080, h: 608, scale: 0.5625 } Nothing is lost, but the video is now a 1080×608 strip with a 656-pixel bar above and below. It occupies 31.7% of the screen: the same number as before, seen from the other side. Crop keeps a third of the picture at full size; letterbox keeps all of the picture at a third of the size.
Option 3: blur-fill
Blur-fill is letterbox with the bars replaced: draw the frame once as a crop that fills the canvas, blur it heavily, then draw the letterboxed frame on top. It uses both functions above, one after the other. The viewer still sees the whole picture, and the empty space reads as intentional. It costs an extra full-frame draw and a blur per frame.
What about stretching?
Scaling 1920×1080 directly to 1080×1920 squeezes the width to 56% and stretches the height to 178%. Every face and every circle is distorted. It is almost never what you want.
Choosing
| Situation | Use |
|---|---|
| One subject, roughly centred, not moving much | Crop, centre window |
| One subject that moves | Crop with an animated focus point |
| Wide shot where the composition is the point | Letterbox or blur-fill |
| Two subjects on opposite sides of the frame | Letterbox, or cut between two crop windows |
| Text burned in across the full width | Letterbox; a crop will cut the words |
The other common targets
The same functions cover every target. For a 1920×1080 source:
| Target | Size | Crop window | Width kept |
|---|---|---|---|
| 9:16 | 1080×1920 | 608×1080 | 31.7% |
| 4:5 | 1080×1350 | 864×1080 | 45.0% |
| 1:1 | 1080×1080 | 1080×1080 | 56.3% |
Square and 4:5 are far more forgiving than 9:16, which is worth remembering when one master has to feed several platforms.
If you would rather not write the rendering yourself, Skrrol's aspect ratio converter runs in the browser, with project presets for 16:9, 9:16, 1:1, 4:5 and 21:9.

