Skip to content

Conversion · Next.js (App Router)

What size should an og:image be in Next.js (App Router)

Facebook, LinkedIn and Slack drop to the small square layout below roughly 600×315, so the image appears as a thumbnail beside the text instead of above it. Platforms crop toward 1.91:1 from the centre, so anything much taller or wider loses its edges — usually where the product name sits. 1200×630 is the safe size.

The fix for Next.js (App Router)

13x detects your framework from the response and hands you this version rather than the generic one — below 50% confidence it hedges and gives you the generic one instead.

Generate it at the right size at build time with app/opengraph-image.tsx:

tsx code
import { ImageResponse } from "next/og";

export const size = { width: 1200, height: 630 };
export const contentType = "image/png";

export default function Image() {
  return new ImageResponse(
    (
      <div
        style={{
          width: "100%",
          height: "100%",
          display: "flex",
          flexDirection: "column",
          justifyContent: "center",
          padding: 80,
          background: "#0b0b12",
          color: "#fff",
          fontSize: 64,
        }}
      >
        <div style={{ display: "flex" }}>example.com</div>
      </div>
    ),
    size
  );
}

Next emits og:image plus the width and height tags automatically. Two constraints: every element needs an explicit display, and only inline styles work — there is no stylesheet.

On a different stack? The general version of this fix explains what 13x checks and why it matters, without assuming a framework.

Check your Next.js (App Router) site

113 deterministic checks against your live URL, in about 30 seconds. Framework detected from the response, so every fix comes back in the form your stack actually uses.

No signup. Results in 30 seconds.