Markdown Cleaner

Clean messy Markdown, normalize formatting, and prepare it for NotebookLM, documentation, or publishing.

Paste messy Markdown from ChatGPT, Claude, Reddit, or GitHub and get clean, consistent formatting in your browser — normalized headings, lists, and spacing, ready for NotebookLM.

Markdown copied from ChatGPT, Claude, Gemini, Reddit threads, GitHub READMEs, OCR scans, and PDF exports rarely comes out clean. Headings are missing their space after the #, bullet lists mix *, +, and • on the same page, numbered lists restart at 1 after every paragraph break, blank lines pile up in threes and fours, and invisible characters sneak in from copy-paste. None of that is obvious when you're staring at rendered text in a chat window — but it becomes very obvious the moment you import that Markdown into NotebookLM, a static site generator, or a documentation platform that expects well-formed syntax. Markdown Cleaner normalizes all of it in your browser: consistent heading syntax, uniform list markers and numbering, tidy blockquotes and code fences, single blank lines between sections, and straight punctuation instead of curly quotes. Paste in whatever mess you have, and get Markdown that's ready to publish, import, or archive.

How it works

  1. Paste your messy Markdown — Drop in Markdown copied from ChatGPT, Claude, Gemini, Reddit, GitHub, a PDF, or an OCR scan — however rough the formatting is.
  2. Watch it clean up instantly — Headings, lists, blockquotes, code fences, and spacing normalize in real time as you type, right there in your browser — no upload, no processing delay.
  3. Copy or download the result — Grab the cleaned Markdown to paste into NotebookLM, commit to a repo, or publish — or download it as a ready-to-use .md file.

Why this helps NotebookLM

NotebookLM is only as good as the sources you give it. When you paste Markdown straight from a chat export or a Reddit thread, small formatting inconsistencies — missing spaces after heading markers, mismatched bullet styles, doubled-up blank lines — don't just look messy, they change how NotebookLM parses the document's structure.

A cleanly formatted source gives NotebookLM a heading hierarchy it can trust, lists it can enumerate correctly, and paragraph breaks that mark real topic boundaries. That translates directly into better summaries, study guides that group related ideas together, and audio overviews that follow the source's actual structure instead of guessing at it.

Because Markdown Cleaner runs entirely in your browser, you can clean a source and drop it straight into a NotebookLM notebook in the same tab — no export, no upload, no round trip through another app.

What you need to know

Why messy Markdown hurts readability

Markdown was designed to be readable even before it's rendered — a heading should look like a heading, a list should look like a list, right there in the plain text. When that structure breaks down, the plain-text version becomes hard to scan: a #Heading with no space after the hash renders correctly in some parsers and not at all in others; a paragraph with three or four stray blank lines reads like broken formatting instead of intentional spacing; bullet points that mix *, -, and • on the same page create visual noise even though they're supposed to signal the exact same thing. This matters more than it looks. Readers — and the tools that process Markdown on their behalf, from static site generators to note-taking apps to AI assistants — rely on consistent syntax to infer structure. Inconsistent formatting doesn't just look sloppy; it actively degrades how reliably a document's hierarchy, lists, and emphasis get parsed and displayed downstream.

Why NotebookLM works better with structured documents

NotebookLM builds its understanding of a source almost entirely from its structure. A clear heading hierarchy tells it where one topic ends and another begins. Consistent lists tell it which points are enumerable and related. Clean paragraph breaks tell it where one idea stops and the next starts. When you import a source with inconsistent headings, mismatched list markers, or leftover formatting artifacts from a copy-paste, NotebookLM has to guess at structure it can't reliably infer — which shows up later as summaries that miss key points, study guides that group unrelated ideas together, or citations that reference the wrong section of a long document. Cleaning Markdown before you import it isn't a cosmetic step. It's the difference between NotebookLM treating your source as a well-organized document versus a wall of undifferentiated text.

Common copy-paste issues from AI tools

Every AI chat interface renders Markdown for you, which means the underlying source text often ships with quirks you never see until you copy it out. ChatGPT and Claude both frequently emit inconsistent blank-line spacing between paragraphs and list items, especially in longer, multi-turn responses. Gemini exports sometimes carry invisible zero-width characters and non-standard whitespace left over from its own rendering pipeline. Reddit's Markdown flavor uses its own conventions for quotes and links that don't always translate cleanly into standard Markdown. And content that's passed through OCR or extracted from a PDF tends to accumulate stray leading spaces, inconsistent line endings, and smart quotes swapped in for straight ones. None of these issues are visible in the chat window itself — they only surface once you paste the raw text somewhere that expects clean, standards-compliant Markdown.

Why cleaning Markdown improves documentation quality

Documentation lives or dies by consistency. A README, wiki page, or knowledge-base article with mixed heading styles, inconsistent list formatting, or irregular spacing is harder to maintain, harder to diff in version control, and more likely to render differently across the Markdown parsers used by GitHub, static site generators, and documentation platforms — which don't all interpret edge cases identically. Cleaning Markdown before you commit or publish it removes that ambiguity: every heading follows the same syntax, every list uses the same marker, every code block opens and closes properly, and every file uses the same line endings. The result is documentation that renders the same way everywhere, is easier to review in a pull request, and stays consistent as multiple contributors add to it over time.

Common use cases

What’s preserved

What’s removed

Frequently asked questions

Can you show an example of before/after cleaning?

Yes — see the before/after comparison and example output further down this page. In short: #Title becomes # Title, mixed */+/• bullets all become -, numbered lists get renumbered in order, three or four blank lines collapse into one, and ** bold** becomes **bold**.

Why use a Markdown Cleaner at all?

Markdown from AI chats, Reddit, GitHub, and PDF exports is rarely well-formed. Small inconsistencies — missing spaces after heading markers, mismatched list bullets, uneven spacing — don't just look messy, they change how downstream tools like NotebookLM, static site generators, and documentation platforms parse the document's structure. Cleaning it first produces a source that renders and imports predictably everywhere.

Does this send my content anywhere?

No. Markdown Cleaner runs entirely in your browser using local JavaScript — there's no backend, no API call, and no AI model involved. Your Markdown never leaves your device, isn't stored, and isn't logged.

Can I clean ChatGPT output with this?

Yes. Paste any ChatGPT response directly into the input panel. It's especially useful for longer, multi-turn responses where blank-line spacing and list formatting tend to drift.

Does it work with Claude output too?

Yes — Markdown Cleaner isn't tied to any single AI tool. It works the same way on Markdown from Claude, Gemini, Reddit, GitHub, OCR scans, or anywhere else you copy formatted text from.

Can I use this before importing into NotebookLM?

That's exactly what it's built for. Clean your Markdown here first, then copy or download it and add it to your NotebookLM notebook as a text source. A well-structured source gives NotebookLM a heading hierarchy and list structure it can parse reliably, which improves summaries, study guides, and audio overviews.

Does it preserve my code blocks?

Yes. Fenced code blocks are detected and left untouched — their contents are never reformatted, reindented, or otherwise modified, even while headings, lists, and spacing are being cleaned up around them. Only the fence markers themselves are normalized for consistency.

← Back to Toolkit · Resources