WordPress Image Size Calculator

See exactly which image files WordPress creates for an upload — every size, crop, -scaled copy and srcset width — and generate add_image_size() code.

Runs in your browser

Uploaded image

px
px
Format

Settings → Media sizes

SizeMax widthMax heightCrop
No
No
No
15361536No
20482048No

Untick a size to see the effect of removing it. 0 means “no limit”. 1536x1536 and 2048x2048 are registered in code (WordPress 5.3+) and are not shown in Settings → Media.

Uploads wider or taller than this are scaled down to a “-scaled” copy that becomes the full size. The original is kept. PNGs are never scaled.

px

Custom sizes (add_image_size)

Custom size 1

Files created on upload

Files per upload
9
Full size
2560×1920
srcset widths
5
SizeRuleResultFile
Originaluploaded file4032×3024photo.jpg
full (scaled)≤ 2560px2560×1920photo-scaled.jpg
thumbnail150×150, cropped (center)150×150photo-150x150.jpg
medium300×300, proportional300×225srcsetphoto-300x225.jpg
medium_large768×∞, proportional768×576srcsetphoto-768x576.jpg
large1024×1024, proportional1024×768srcsetphoto-1024x768.jpg
1536x15361536×1536, proportional1536×1152srcsetphoto-1536x1152.jpg
2048x20482048×2048, proportional2048×1536srcsetphoto-2048x1536.jpg
cardcustom600×400, cropped (center)600×400photo-600x400.jpg
The image exceeds the 2560px threshold, so WordPress saves photo-scaled.jpg and uses it as the “full” size on the front end. Sub-sizes are still generated from the original for best quality, and the original is kept for regenerating thumbnails.

When this image is inserted at a size with the same aspect ratio, WordPress builds srcset from these widths: 300w, 768w, 1024w, 1536w, 2048w. Files wider than 2048px are left out (max_srcset_image_width), and cropped sizes with a different ratio are never mixed in.

PHP for your theme

functions.php

<?php

/**
 * Register custom image sizes.
 */
function acme_register_image_sizes() {
	add_image_size( 'card', 600, 400, true );
}
add_action( 'after_setup_theme', 'acme_register_image_sizes' );

/**
 * Make the custom sizes selectable in the block editor and media modal.
 *
 * @param array $sizes Image size names and labels.
 * @return array
 */
function acme_image_size_names( $sizes ) {
	return array_merge(
		$sizes,
		array(
			'card' => __( 'Card', 'acme' ),
		)
	);
}
add_filter( 'image_size_names_choose', 'acme_image_size_names' );

How does WordPress resize uploaded images?

Every time you upload an image, WordPress creates several resized copies (“sub-sizes”) so themes can serve an appropriately sized file instead of the multi-megabyte original. Out of the box that means thumbnail (150×150, cropped), medium (300×300), medium_large (768 wide), large (1024×1024) and, since WordPress 5.3, 1536x1536 and 2048x2048. Themes and plugins add more with add_image_size(), which is why a single upload can turn into ten or more files.

Proportional sizes are bounding boxes: the image is shrunk until it fits inside the width and height, keeping its aspect ratio (wp_constrain_dimensions()). Cropped sizes are resized to cover the box and then cut to the exact dimensions from the chosen crop position (image_resize_dimensions()). WordPress never upscales: if the original is not larger than a size in either dimension, that file is simply not created.

Uploads larger than the big image size threshold (2560px by default) are scaled down to a -scaled copy that becomes the “full” size used on the front end; the original is kept, and sub-sizes are still generated from it. This calculator runs ports of those core functions in your browser, so the dimensions match what WordPress actually produces.

How to use the WordPress Image Size Calculator

  1. Enter the width and height of the image you plan to upload, or choose a preset such as a 4032×3024 phone photo. Pick PNG if applicable — PNGs are never scaled by the threshold.
  2. Adjust the default sizes to match Settings → Media, untick sizes you want to disable, and change or turn off the big image threshold.
  3. Add your theme’s custom sizes with width, height, hard crop and crop position.
  4. Read the table of generated files and srcset widths, then copy the PHP to register the sizes, disable unused ones and adjust the threshold.

Example

A 4032×3024 photo with the default settings creates 8 files:

photo.jpg               4032×3024  (original, kept)
photo-scaled.jpg        2560×1920  (full size)
photo-150x150.jpg        150×150   thumbnail
photo-300x225.jpg        300×225   medium
photo-768x576.jpg        768×576   medium_large
photo-1024x768.jpg      1024×768   large
photo-1536x1152.jpg     1536×1152  1536x1536
photo-2048x1536.jpg     2048×1536  2048x2048

How srcset uses these files

When an image is output with wp_get_attachment_image() or inserted in a post, WordPress adds a srcset attribute listing every generated file with the same aspect ratio as the displayed size, up to 2048px wide (max_srcset_image_width). The browser then picks the smallest file that fills the slot on the visitor’s screen. Cropped sizes with a different ratio, such as a square thumbnail of a landscape photo, are never mixed in — which is why a good set of proportional sizes matters more for performance than many cropped ones.

Tips for choosing image sizes

  • Register only the sizes your theme actually uses: each size multiplies storage and upload processing time.
  • Disable sizes you never output with the intermediate_image_sizes_advanced filter — the generated PHP does this for any size you untick.
  • Use hard crops for grids and cards that need identical shapes; use proportional sizes for content images so srcset can work.
  • After adding or changing sizes, regenerate existing images with wp media regenerate --only-missing (WP-CLI) or a regenerate-thumbnails plugin.
  • Need the dimensions for a specific ratio? Use the Aspect Ratio Calculator, and register sizes alongside other theme code with the functions.php generator.

Frequently Asked Questions

Why does WordPress add “-scaled” to my image file names?

Since WordPress 5.3, images wider or taller than 2560px are scaled down and saved with a -scaled suffix. That copy is used as the full-size image on the site, while the original stays on the server. Return a different number from the big_image_size_threshold filter to change the limit, or false to disable it.

Why was a size not generated for my image?

WordPress does not upscale. If the original is smaller than or equal to the size in both dimensions — or within one pixel of the original — no file is created and the next larger file (or the original) is used instead.

What is the difference between hard crop and soft crop?

Soft crop (proportional) fits the whole image inside the box, so one dimension is usually smaller than requested. Hard crop fills the box exactly and trims the overflow from the chosen position, e.g. array( 'center', 'top' ) keeps the top of the image.

How do I change the thumbnail, medium and large sizes?

In Settings → Media, or with WP-CLI such as wp option update medium_size_w 400. These sizes are stored as options, not code. The 1536 and 2048 sizes are registered in code by core and can be removed with the intermediate_image_sizes_advanced filter.

Does WordPress create WebP or AVIF sizes?

WordPress keeps the uploaded format by default. WebP and AVIF uploads are resized like JPEGs, and since WordPress 5.8/6.5 support is built in; converting JPEG sub-sizes to WebP requires the image_editor_output_format filter or a plugin.