Getting Started
Hyper Compress can be used in a few different ways, but the engine underneath is always the same. Whether you're using the CLI, Node SDK, WebAssembly build, or something else, you'll get the same presets, the same 30 options, and the same result from the same settings.
Pick the way you want to use Hyper, and this guide will help you compress your first PDF.
The fastest way: your browser
If you just want to compress a PDF, you do not need to install anything.
- Open hyper.bentopdf.com.
- Drop your PDF onto the page, or click to choose it.
- Pick a compression level and press Compress.
- Save the result.
The engine runs as WebAssembly inside your browser. Your file is never uploaded anywhere; you can load the page, disconnect from the internet, and it still works.
From the terminal
What you need first
Node.js 22 or newer. Check what you have:
node --versionIf that prints v22.0.0 or higher you are ready. If it prints something lower, or command not found, install the current LTS from nodejs.org and open a new terminal.
Supported platforms for the native engine: macOS on Apple silicon, Linux x64, Windows x64. On anything else (an Intel Mac, a Raspberry Pi), use the WebAssembly package instead.
Install and run
npm install -g hyper-compress
hyper input.pdfYou should see something like:
input-compressed.pdf
2593056 -> 1250960 bytes (52% smaller)That is the whole workflow. The first line is where the result was written, next to your input as <input>-compressed.pdf; the second is the input size, the output size, and the saving. To choose the output name yourself, pass it as a second argument: hyper input.pdf smaller.pdf.
Prefer not to install globally? npx hyper input.pdf works from any folder after npm install hyper-compress in that folder.
Common variations:
hyper input.pdf out.pdf --preset high # smallest output
hyper scan.pdf out.pdf --target-size 2MB # aim for a size
hyper locked.pdf out.pdf --password hunter2 # encrypted inputEvery flag is documented on the CLI page, including what to do when something goes wrong.
From Node.js code
Same install, used as a library:
import { compress } from 'hyper-compress';
const result = await compress({
sourcePath: 'input.pdf',
savePath: 'output.pdf',
preset: 'medium',
});
console.log(`${result.originalSize} -> ${result.compressedSize} bytes`);Save that as compress.mjs next to an input.pdf and run node compress.mjs. The Node SDK page walks through passwords, target sizes, cancellation, batching and error handling.
As a service for your team
If you have Docker installed, one command gives you a private compression service with a web page and an API:
docker run -d -p 8080:8080 ghcr.io/alam00000/bentopdf-hyper-compress:latestOpen http://localhost:8080 for the interface, or POST a PDF to /api/compress. Everything runs on your machine. Setup, tuning and TLS are covered in Self-Hosting, the API in HTTP API.
The presets
Every surface uses the same four presets. Pick by what the document is for:
| Preset | Image quality | Max DPI | Use for |
|---|---|---|---|
low | 80 | 200 | archival copies and minimal visible change |
medium | 50 | 150 | the default; sharing and email |
high | 20 | 72 | smallest output and screen reading |
lossless | off | off | no image re-encoding, pixel-identical images |
A preset is just a complete options object; start from one and override any field. The options reference lists all 30 options and exactly what each preset sets.
Three things to know before you start
- The output is never larger than the input. Your PDF will never come back bigger. If Hyper can't make it smaller, you get the original file back instead.
- Some documents come back unchanged on purpose. A digitally signed PDF is returned untouched, because compressing it would break the signature. The result tells you when this happened.
- Hyper tells you when it skips something. Results carry a
warningslist (the CLI prints them) explaining anything that was skipped for safety, like rasterizing a document that still has selectable text.
The full behavioral contract is on the guarantees page.
Where next
- All flags and troubleshooting: CLI
- The full programming interface: Node SDK
- Running without native binaries: WebAssembly
- Your own service: Self-Hosting and the HTTP API
- Every option with defaults and ranges: Options reference
- What was measured against Ghostscript, MuPDF and qpdf: Benchmarks