Git Conventional Commit & URL Converter
About Markdown Minifier
The Markdown Minifier & Token Compressor strips redundant whitespace, removes empty comment lines, collapses blank line gaps, and compresses tables to minimize `.md` byte size for LLM prompt context windows and API payloads.
How to Use Markdown Minifier
Step 1
Paste your Markdown content into the input pane.
Step 2
Toggle minification rules (Strip comments, Collapse blank lines, Compact tables).
Step 3
Review the compressed Markdown and byte savings metrics.
Step 4
Click "Copy Minified Markdown".
Practical Use Cases for Markdown Minifier
Compressing Markdown for LLM Prompt Context Windows
Reduce token consumption and byte size by minifying Markdown documentation before sending it to OpenAI, Anthropic, or Gemini API prompts.
Optimizing Embedded Markdown in Web Apps
Compress inlined Markdown strings in JavaScript bundles to reduce client bundle download sizes.
Input & Output Examples
Minifying Markdown with Excess Spacing
`# Header\n\n\n\nParagraph text\n\n<!-- comment -->`
`# Header\nParagraph text`
Key Features & Performance
- ✓Compresses Markdown while strictly preserving AST semantic rendering.
- ✓Strips HTML comments (`<!-- ... -->`) and redundant table whitespace.
- ✓Displays byte savings and estimated LLM token reduction percentage.
- ✓100% Client-Side memory execution.
- ✓1-Click Copy minified Markdown.
Key Terminology & Definitions
Token Optimization
Reducing the count of BPE tokens in a prompt to lower LLM API billing costs and stay within context limits.
Semantic Preservation
Ensuring that minified markup renders identical HTML output when parsed by a CommonMark compliant engine.
