The short answer: 1000 × 1500, a 2:3 ratio. That is the shape that fills a post on Pinterest without cropping, and it is the one to use unless you have a reason not to.
Why 2:3
Pinterest is the one platform with a genuinely strict preference: 2:3 is the standard pin, and taller or wider images get truncated in the grid. It is also the platform where code images have the longest life, since pins keep surfacing months after posting.
The settings
In Codeshot, under Aspect Ratio, switch from Original to Fixed and pick the 2:3 shortcut. Then set the width to 500 and export at 2×.
That gives you exactly 1000 × 1500. Exporting at 2× rather than 1× is what keeps small text sharp on a retina display — a 1× export of a code snippet always looks slightly soft.
Other sizes that work
| Ratio | Pixels | Use it when |
|---|---|---|
| 1:1 | 1000 × 1000 | the pin is part of a collection |
Each is the same three settings: the ratio, a width, and a 2× export.
The mistake to avoid
Posting a landscape snippet. Pinterest's grid is vertical, and a 16:9 image is shown so small that it is skipped. If your code will not fill a 2:3 frame, add a title above it rather than stretching the frame to fit.
One more thing
2:3 is a ratio shortcut, so this one is a single click. A width of 500 at 2× gives exactly the 1000 × 1500 Pinterest recommends.
Sizes for other platforms
- X (Twitter) — 1600 × 900 at 16:9
- LinkedIn — 1080 × 1080 at 1:1
- Facebook — 1080 × 1080 at 1:1
See all articles for the rest, including the other platforms.
Whichever platform you post to, the theme matters as much as the size once the image is scaled down. You can compare all 30 before you pick one.