# Image resizer

> Resize by pixels or percent, with the aspect ratio locked and a batch ZIP.

Free image resizer. Set a width, a height, or a percent, lock the aspect ratio, and fit a batch with contain, cover, or stretch. Presets cover Instagram, Stories, Open Graph, and HD. Resizing runs in the browser, so the files stay on the device.

- Page: https://benchline.fabwaseem.com/t/image-resize
- Runs: in the browser. Input stays on the device.
- Price: free, no account
- Input: Images, a pixel width and height or a percent, an aspect lock, a fit mode, and an output format.
- Output: Resized images at the computed pixel size, plus a ZIP for the batch.
- Keywords: resize image, image resizer, resize jpg, resize png, image size in pixels
- Updated: 2026-10-18
- Built by: Waseem Anjum (https://fabwaseem.com)

## How to use it

1. **Drop the images.** Add one picture or a batch. Each row shows the original pixel size.
2. **Set pixels, a percent, or a preset.** Leave one side empty to keep each image's ratio. Fill both sides and pick contain, cover, or stretch for a fixed frame.
3. **Download the resized files.** Save a single image or a ZIP. Pick JPG, PNG, WebP, or AVIF for the output.

## Use it from an AI agent

MCP tool name: `resize_image`
MCP endpoint: https://benchline.fabwaseem.com/mcp (Streamable HTTP, no key)
HTTP: POST https://benchline.fabwaseem.com/api/v1/tools/image-resize with the input as the JSON body
This call fetches a public URL on the server. Private addresses are refused.

Resize an image by pixels or percent. Fit is contain, cover, or stretch. Send base64 or a public URL. Private addresses are refused and the decoded file is capped at 10 MB. Returns the image as base64.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "file": {
      "type": "object",
      "properties": {
        "url": {
          "description": "Public http or https URL. Private and local addresses are refused.",
          "type": "string"
        },
        "data": {
          "description": "Base64 bytes or a data URI. Decoded size is capped at 10 MB.",
          "type": "string"
        },
        "mimeType": {
          "description": "MIME type when you know it.",
          "type": "string"
        },
        "filename": {
          "description": "File name, including the extension when you have one.",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "description": "The image. Provide url or data."
    },
    "mode": {
      "default": "pixels",
      "type": "string",
      "enum": [
        "pixels",
        "percent"
      ]
    },
    "width": {
      "default": null,
      "anyOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "height": {
      "default": null,
      "anyOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "percent": {
      "default": 100,
      "type": "number"
    },
    "lockAspect": {
      "default": true,
      "type": "boolean"
    },
    "fit": {
      "default": "contain",
      "type": "string",
      "enum": [
        "contain",
        "cover",
        "stretch"
      ]
    }
  },
  "required": [
    "file",
    "mode",
    "width",
    "height",
    "percent",
    "lockAspect",
    "fit"
  ],
  "additionalProperties": false
}
```

### Example tools/call

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "resize_image",
    "arguments": {
      "file": {
        "url": "https://example.com/file"
      },
      "mode": "pixels",
      "width": null,
      "height": null,
      "percent": 100,
      "lockAspect": true,
      "fit": "contain"
    }
  }
}
```

Setup for Claude, Cursor, and VS Code: https://benchline.fabwaseem.com/mcp/guide

## Questions

### Are the images uploaded?

No. The resized pixels are drawn in this browser. The file does not leave the device.

### How does the aspect lock work?

With one side filled in, each image keeps its own ratio. With both width and height filled in, every image is fitted into that same frame.

### What is the difference between contain, cover, and stretch?

Contain fits the whole image inside the frame and leaves bars. Cover fills the frame and crops the overflow. Stretch maps the image to the exact width and height.

### Can I resize by percent?

Yes. Percent scales every image by the same amount and keeps each ratio. 50 makes a 2000 pixel photo into 1000.

### What are the presets?

Instagram square is 1080×1080, portrait is 1080×1350, Story is 1080×1920, Open Graph is 1200×630, HD is 1920×1080, and the thumbnail is 320×320.

## Related tools

- [Image compressor](https://benchline.fabwaseem.com/t/image-compress): Shrink JPEG, PNG, WebP, and AVIF in the browser, with the real before and after size.
- [Image format converter](https://benchline.fabwaseem.com/t/image-convert): Convert HEIC, WebP, PNG, JPG, and AVIF in the browser. Nothing is uploaded.
- [OG image generator](https://benchline.fabwaseem.com/t/og-image-generator): Pick a template, watch the card update, then download the PNG or copy the Next.js file.
- [Color converter](https://benchline.fabwaseem.com/t/color-converter): Turn any color into HEX, RGB, HSL, OKLCH, and CMYK, and check the contrast ratio.
