Aspect Ratio Crops
Switch between 1:1, 4:5, 16:9, 9:16 and 21:9 and see how the same scene is cropped.
AI prompt
Wide cinematic photograph of a lone hiker on a ridge at sunrise, 21:9 aspect ratio, subject on the right third with a vast glowing valley to the left, mist layers, warm light, anamorphic feel. Ratio variants: 9:16 vertical (subject centred and tall, sky above and trail below, composed for a phone screen), 4:5 portrait (subject and ridge, balanced), 1:1 square (subject centred, symmetrical), 16:9 landscape. Compose with safe margins so the subject survives each crop. Negative: cut-off heads, stretched or squashed proportions, text near the edges, black bars.About this pattern
Definition
The aspect ratio is the width-to-height proportion of an image or video. The same scene feels different in each: square is stable, vertical is intimate and mobile, wide is cinematic.
When to use it
- Match the format to the destination: 9:16 for stories and shorts, 4:5 for feeds, 1:1 for avatars and grids, 16:9 for video and web, 21:9 for cinematic scope.
- Compose with the crop in mind; keep the subject and key details inside the safe centre.
- State the aspect ratio in every image or video prompt.
What the controls do
- Five buttons choose the ratio; the frame animates to the new proportion and the note names typical uses.
Motion & timing
- Frame resize eases over 350ms.
- Reduced motion: it changes instantly.
Tips & variations
- If one image must work in many formats, shoot or generate wider and leave room around the subject.
- Check that text and faces survive each crop.
Code of this live preview
<div class="bx"><div class="hold"><div class="fr" id="fr"><div class="sky"></div><div class="sun"></div><div class="mt m1"></div><div class="mt m2"></div><div class="hk"></div></div></div>
<div class="pre" id="pre" role="group" aria-label="Aspect ratio"><button data-r="1/1">1:1</button><button data-r="4/5">4:5</button><button data-r="16/9" aria-pressed="true">16:9</button><button data-r="9/16">9:16</button><button data-r="21/9">21:9</button></div><p class="out" id="out" aria-live="polite"></p></div>:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
.bx{width:min(300px,100%);display:grid;gap:8px}
.hold{height:160px;display:grid;place-items:center;border-radius:12px;background:#e6e6e2}
.fr{position:relative;overflow:hidden;height:var(--h,100px);aspect-ratio:var(--r,16/9);background:#f3b36a;transition:height .35s,aspect-ratio .35s}
.sky{position:absolute;inset:0;background:linear-gradient(#f08a5a,#f7d9a0 65%,#7e8fa0 65%)}
.sun{position:absolute;left:62%;top:30%;width:22%;aspect-ratio:1;border-radius:50%;background:#fff4cf;max-width:34px}
.mt{position:absolute;bottom:0;left:-10%;right:-10%}
.m1{height:44%;background:#6b7a8c;clip-path:polygon(0 100%,0 60%,22% 20%,45% 55%,70% 10%,100% 50%,100% 100%)}
.m2{height:28%;background:#46546a;clip-path:polygon(0 100%,0 40%,30% 10%,60% 50%,100% 0,100% 100%)}
.hk{position:absolute;left:46%;bottom:26%;width:7%;height:26%;min-width:6px;background:#111;border-radius:40% 40% 10% 10%}
.pre{display:grid;grid-template-columns:repeat(5,1fr);gap:4px}.pre button{height:28px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font:inherit;font-size:11px;cursor:pointer;padding:0}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
@media (prefers-reduced-motion:reduce){.fr{transition:none}}const fr=document.getElementById('fr'),out=document.getElementById('out'),bs=[...document.querySelectorAll('#pre button')];
const U={'1/1':['1:1','avatars, grids, product tiles',120],'4/5':['4:5','feed portraits',140],'16/9':['16:9','video, web, slides',100],'9/16':['9:16','stories, shorts, reels',150],'21/9':['21:9','cinematic scope',80]};
function show(r){const u=U[r];fr.style.setProperty('--r',r);fr.style.setProperty('--h',u[2]+'px');out.innerHTML='<b>'+u[0]+'</b>: '+u[1];bs.forEach(b=>b.setAttribute('aria-pressed',String(b.dataset.r===r)));}
bs.forEach(b=>b.addEventListener('click',()=>show(b.dataset.r)));show('16/9');One complete HTML file. Save it and open it in a browser.
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Aspect Ratio Crops — demo</title>
<style>
:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
html,body{height:100%}body{background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif;-webkit-font-smoothing:antialiased}.stage{min-height:100%;display:grid;place-items:center;padding:24px}button,input,select,textarea{font-family:inherit}@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
.bx{width:min(300px,100%);display:grid;gap:8px}
.hold{height:160px;display:grid;place-items:center;border-radius:12px;background:#e6e6e2}
.fr{position:relative;overflow:hidden;height:var(--h,100px);aspect-ratio:var(--r,16/9);background:#f3b36a;transition:height .35s,aspect-ratio .35s}
.sky{position:absolute;inset:0;background:linear-gradient(#f08a5a,#f7d9a0 65%,#7e8fa0 65%)}
.sun{position:absolute;left:62%;top:30%;width:22%;aspect-ratio:1;border-radius:50%;background:#fff4cf;max-width:34px}
.mt{position:absolute;bottom:0;left:-10%;right:-10%}
.m1{height:44%;background:#6b7a8c;clip-path:polygon(0 100%,0 60%,22% 20%,45% 55%,70% 10%,100% 50%,100% 100%)}
.m2{height:28%;background:#46546a;clip-path:polygon(0 100%,0 40%,30% 10%,60% 50%,100% 0,100% 100%)}
.hk{position:absolute;left:46%;bottom:26%;width:7%;height:26%;min-width:6px;background:#111;border-radius:40% 40% 10% 10%}
.pre{display:grid;grid-template-columns:repeat(5,1fr);gap:4px}.pre button{height:28px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font:inherit;font-size:11px;cursor:pointer;padding:0}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
@media (prefers-reduced-motion:reduce){.fr{transition:none}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="hold"><div class="fr" id="fr"><div class="sky"></div><div class="sun"></div><div class="mt m1"></div><div class="mt m2"></div><div class="hk"></div></div></div>
<div class="pre" id="pre" role="group" aria-label="Aspect ratio"><button data-r="1/1">1:1</button><button data-r="4/5">4:5</button><button data-r="16/9" aria-pressed="true">16:9</button><button data-r="9/16">9:16</button><button data-r="21/9">21:9</button></div><p class="out" id="out" aria-live="polite"></p></div>
</div>
<script>
const fr=document.getElementById('fr'),out=document.getElementById('out'),bs=[...document.querySelectorAll('#pre button')];
const U={'1/1':['1:1','avatars, grids, product tiles',120],'4/5':['4:5','feed portraits',140],'16/9':['16:9','video, web, slides',100],'9/16':['9:16','stories, shorts, reels',150],'21/9':['21:9','cinematic scope',80]};
function show(r){const u=U[r];fr.style.setProperty('--r',r);fr.style.setProperty('--h',u[2]+'px');out.innerHTML='<b>'+u[0]+'</b>: '+u[1];bs.forEach(b=>b.setAttribute('aria-pressed',String(b.dataset.r===r)));}
bs.forEach(b=>b.addEventListener('click',()=>show(b.dataset.r)));show('16/9');
</script>
</body></html>