Compressed Image
{{ compressedSizeKB }} KB  ·  −{{ savingPercent }}%
On‑device only. Your files never leave this browser.
Download Open
Orig {{ originalSizeKB }} KB {{ originalWidth }} × {{ originalHeight }} {{ compressedWidth }} × {{ compressedHeight }} Format {{ String(format||'').toUpperCase() }} Q {{ quality }}% Target {{ targetSizeKB }} KB
Image:
{{ dropZoneText }}
Paste works, too. Accepted: image/*
{{ quality }}%
×

Original image
Compressed image
Left: compressed · Right: original
Metric Value Copy
{{ r.label }} {{ r.value }}
Add an image to see details.
{{ batchDoneCount }}/{{ batch.length }} ({{ batchProgressPct }}%)
Total: {{ batchTotals.totalOriginalKB }} KB → {{ batchTotals.totalCompressedKB }} KB · −{{ batchTotals.savingPercent }}%
# Name Original KB Compressed KB Save % WxH → WxH Copy
{{ idx+1 }} {{ it.name }} {{ it.name }} {{ it.sizeKB }} {{ it.compSizeKB || '' }} {{ it.savingPercent || '' }} {{ (it.width||'—') }} × {{ (it.height||'—') }} → {{ (it.compWidth||'—') }} × {{ (it.compHeight||'—') }}
Batch is empty. Add images or drag‑and‑drop while Batch mode is on.

                

Introduction:

Digital images are pixel based pictures that can grow large in storage and feel slow to send or publish. Compression reduces file size while keeping familiar detail that looks right for everyday viewing. Many projects benefit from image compression with target file size so results fit limits without guesswork.

You provide a photo, choose how small you want it, and optionally resize it so the longest side or a maximum width and height are respected. A simple compare view shows the original beside the compressed version so you can judge clarity before saving.

Pick a quality level if you want a quick result, or set a size in kilobytes when you must meet an attachment or upload cap. A balanced preset helps when you are unsure, and you can adjust in small steps until the tradeoff feels right.

Results vary with image content, so smooth skies and flat colors usually shrink more than fine textures and grain. Keep your original file so you can retry different settings later without cumulative loss.

Technical Details:

The core quantity is file size in kilobytes and the visual footprint in pixels. The compressor re‑encodes the image with a quality factor and can scale dimensions by fit, percentage, or by setting the long edge in pixels. Exchangeable Image File Format (EXIF) metadata can be retained or removed, and camera orientation tags can be honored to prevent sideways previews.

The computation transforms the original image into a new encoded form using a quality ratio Q between 0.1 and 1.0. When a size target is set for compatible formats, the engine iteratively adjusts Q to approach the requested kilobytes. If resizing is enabled, new dimensions are calculated first, then encoding is performed on the resized bitmap.

Results are interpreted by comparing compressed size, dimensions, and visual inspection in the preview. Lower Q yields smaller files and fewer fine details; resizing reduces pixels and often dominates savings. Lossless outputs ignore the quality control and preserve exact pixel values, while lossy outputs trade some detail for smaller size.

Comparability improves when you keep lighting, subject texture, and dimensions similar across runs. The target size search accepts any outcome within a tolerance of the larger of 8 KB or 4% of the target, which prevents oscillation on difficult images.

saving% = max(0, 1 ScompSorig )×100
tol = max(8,0.04×T)
Symbols and units
Symbol Meaning Unit/Datatype Source
QQuality ratio used during encoding0.1–1.0Input (from slider)
Q%Displayed quality percentage1–100 %Input
W, HImage width and heightpxDerived (natural size or resized)
LLong edge settingpxInput
TTarget file sizeKB (1024 bytes)Input
SorigOriginal file sizeKB (2 decimals)Derived
ScompCompressed file sizeKB (2 decimals)Derived
fmtOutput format family"jpeg" | "webp" | "png"Input
Worked example.
Suppose Sorig = 2048 KB and you set a target T = 400 KB.
tol=max(8,0.04×400)=16 KB
After up to seven passes, an output of 412 KB is accepted because it is within 16 KB of the target.
saving%=14122048=79.9%
Interpretation: about four fifths smaller, with quality set where the tolerance is met.

Processing pipeline

  1. Read the image and record original size and dimensions.
  2. Apply resize rule: none, fit to maximums, percent scale, or long edge.
  3. Pick output format and build encoder options.
  4. Encode once, or iteratively adjust quality toward the target size.
  5. Measure output size and dimensions; compute saving percentage.
  6. Present preview and details; offer CSV and JSON summaries.

Validation & bounds from the interface

Validation limits and options
Field Type Min Max Step/Pattern Error Text Placeholder
ImageFileaccept: image/*
Quality (%)Range1100step 1
Output formatEnumwebp | jpeg | png
Target size (KB)Number0step 1
Convert threshold (KB)Number0step 1
Keep EXIFBooleantoggle
Fix orientationBooleantoggle
Resize modeEnumnone | fit | scale | long
Max width (px)Number0step 1
Max height (px)Number0step 1
Scale (%)Number1step 1
Long edge (px)Number1step 1
Batch modeBooleantoggle or ?batch=1

I/O formats & rounding

Input and output format summary
Input Accepted Families Output Encoding/Precision Rounding
Image file image/* JPEG, WebP, PNG Lossy for JPEG/WebP; PNG lossless Sizes to 0.01 KB; saving to 0.1%

Numbers use a dot as the decimal separator. Displayed sizes round to two decimals; saving percentage rounds to one decimal.

Performance & complexity

Encoding is proportional to the number of pixels. Target size search performs at most seven passes per image. Batch processing is sequential to conserve memory.

Security, privacy & compliance

Compression and conversion run in your browser; image data is not transmitted to a server. Keeping EXIF may include camera and GPS details; remove it for better privacy.

Assumptions & limitations

  • Inputs must advertise an image MIME type; other files are ignored.
  • Heads‑up Target size applies to JPEG and WebP; PNG ignores quality targeting.
  • Lossless outputs preserve pixels but are usually larger than lossy outputs.
  • Fit mode limits width and height independently; it never crops.
  • Long edge mode preserves aspect ratio and rounds to whole pixels.
  • Convert threshold of 0 disables automatic format conversion by size.
  • Orientation fix requires a valid EXIF orientation tag to be present.
  • Retained EXIF increases output size and may reveal location data.
  • Batch ZIP creation is available only when archive support is present.
  • Closing the page during batch work cancels remaining items.

Edge cases & error sources

  • Corrupted or partially downloaded images fail to decode.
  • Images without a MIME type may be rejected.
  • Extremely large dimensions can exhaust memory on older devices.
  • Very small targets may hit the quality floor before reaching size.
  • Percentage scaling below 100 can produce very small thumbnails.
  • Transparency saved to JPEG will be filled against a background.
  • EXIF orientation missing results in original rotation being kept.
  • Decimal rounding can make reported totals differ by 0.01 KB.
  • Interrupting the process can leave temporary object URLs unreleased.
  • Batch items with mixed formats may vary in achievable savings.

Scientific & standards context

Common image families include the JPEG standard for lossy compression, the PNG specification for lossless compression with transparency, and WebP as a modern alternative that supports both modes.

All processing is browser‑based and deterministic for the same inputs and settings.

Step‑by‑Step Guide

Image compression and resizing with a clear preview and a size target.

  1. Add a photo by dropping it, pasting it, or selecting it.
  2. Set Quality or Target size (KB).
  3. Choose Format and whether to keep EXIF and orientation.
  4. Pick a Resize mode and enter dimensions if needed.
  5. Review the compare view and adjust in small steps.
  6. Download the compressed copy, or queue more and export a ZIP.

Example: Set target 400 KB, format WebP, fit to 1920 × 1280; adjust until the preview looks clean.

You now have a smaller image ready for faster sharing.

FAQ

Is my data stored?

No. Processing happens locally in your browser and images are not uploaded. You control whether EXIF stays embedded.

Remove EXIF to minimize personal data.
How accurate is the target size?

Results are accepted when within the larger of 8 KB or 4% of your target. This prevents endless retries on difficult content.

Targets apply to JPEG and WebP.
Which units are used?

File size is shown in kilobytes where 1 KB equals 1024 bytes. Numbers display with a dot as the decimal separator.

Can I keep camera metadata?

Yes. Enable “Keep EXIF” to retain camera and GPS records. Turning it off reduces size and improves privacy.

How do I make a 200 KB image?

Enter 200 in Target size (KB), choose JPEG or WebP, and adjust quality if needed until the preview meets your standard.

Does it work without a network?

Once loaded, compression runs locally. No image data is sent to a server during encoding or resizing.

Is there any cost or license?

There is no payment step in this app. Distribution and licensing follow the host site’s policy.

What does a “borderline” result mean?

It is within the tolerance band around your target, so it is considered acceptable for size‑constrained uses.

Troubleshooting

  • Nothing happens on drop — ensure the file is an image type.
  • Preview looks sideways — enable orientation fix.
  • Target size is never reached — increase tolerance by raising the target.
  • ZIP button is disabled — finish batch processing first.
  • Copy buttons do nothing — allow clipboard access in the browser.
  • Output lacks transparency — pick PNG for images that need alpha.

Advanced Tips

  • Tip Use the balanced preset, then fine tune quality in steps of 5.
  • Tip Fit to 1920 px on the long side for quick sharing without oversizing.
  • Tip Keep EXIF off when posting photos from sensitive locations.
  • Tip Use the compare slider to spot banding or halos at low quality.
  • Tip Prefer WebP for compact results on modern platforms.
  • Tip Keep originals; recompress from the source rather than from a prior output.

Glossary

Quality (Q)
Ratio controlling compression strength for lossy formats.
EXIF
Exchangeable Image File Format metadata, including camera and GPS.
Lossy
Compression that discards detail to reduce file size.
Lossless
Compression that preserves every pixel exactly.
Long edge
The longer side of an image, used to set size quickly.
Tolerance
Accepted distance between target and achieved size.
KB
Kilobyte, equal to 1024 bytes in this app.
Preview
Side by side view to judge clarity before saving.