A little less prompt. A little more room.

Make every
token count.

Turn wordy instructions into a smaller prompt. Compare the result. Keep what works.

No account needed · Free, open-source SDK

Prompt workspace
Free to try
0 words⌘ / Ctrl + Enter

A little less, right here.

Your complete result will appear here.
Complete output, decoder included
Natural-language instructions work best.

Your text is processed by the hosted service. Prompt contents are not saved to our database. Privacy details

Small steps. Clear results.

From first prompt
to your everyday workflow.

01

Start with something real.

Paste a natural-language prompt, or try the sample. Code and detected quoted literals are kept unchanged.

02

See the whole picture.

Compare the complete output, including any decoder. Short inputs may already be as compact as they need to be.

03

Check the answer.

Try both versions with your model. Adopt compression when the answer stays useful and the complete cost improves.

Fits into your code.

One small addition.
Your existing workflow.

Use the JavaScript SDK locally, or the hosted API with a key. You decide which prompts to compress and how to evaluate them.

Read the quick start
JavaScriptnpm install tokenshrink
import { compress } from 'tokenshrink';

const result = compress(yourPrompt);

// Complete output, including any decoder.
const prompt = result.compressed;

// Estimates. Check with your model tokenizer.
console.log(result.stats.tokensSaved);

Designed to earn your trust.

The numbers should
speak for themselves.

Token counts are estimates, not a promise of lower bills or identical answers. Caching, output and retries matter too. Our experimental engine stays separate from the product you use today.