JavaScript SPA to Markdown — Convert Dynamic Pages
A static fetch of a React or Vue SPA returns an empty <code><div id="root"></code> and a script tag. Curl, wget, and most scrapers stop there. Our converter detects JavaScript-required pages, runs them in a real headless browser, waits for the content to settle, then extracts. The result is the same Markdown you'd get from a server-rendered equivalent.
How we detect a JS-required page
Two signals. First, we attempt a static fetch and look at the response. An almost-empty body (<div id="root"></div>, <div id="__next"></div>, near-zero text content, a script tag fetching main.js) is the obvious tell. Second, we look for known SPA framework markers (data-reactroot, ng-version, __NUXT__) and route those URLs through the headless path automatically. You can also force browser rendering with ?render=js.
Wait strategies
The hardest part of SPA scraping isn't rendering — it's knowing when rendering is "done". We support three strategies: networkidle (wait until network requests stop, default), selector (wait until a specific CSS selector appears in the DOM — pass ?wait_for=h1), and timeout (fixed delay in ms, last resort for poorly-instrumented apps). Most pages settle within 2–4 seconds.
How does this handle React and Vue rendered pages?
A real headless Chromium instance loads the URL, runs the JavaScript, waits for the page to settle, then we extract from the rendered DOM. Same result as if a user had opened the page in a browser — including content from useEffect hooks, dynamic imports, and lazy-loaded components.
Does this work on Next.js client-rendered routes?
Yes — pages using getServerSideProps or full SSR work fine via static fetch (we try that first, it's faster and cheaper). Pages using client-side data fetching (useSWR, useQuery, plain useEffect) need the headless path, which we use automatically when the static fetch returns an empty shell.
How long does JS rendering take vs static fetch?
Static fetch: ~200–500ms per page. Headless rendering: ~2–5 seconds per page (browser launch dominates the first request, then amortises). The MDisBetter web tool runs the headless path automatically when needed; if you're rolling your own at scale, Playwright reuses a single browser context across requests for the same speedup.
Can I configure how long to wait for content to load?
Yes — three strategies: networkidle (default), selector (wait for a CSS selector — ?wait_for=.product-grid), or timeout (fixed delay — ?wait_ms=3000). Selector-based waits are the most reliable; use them when you know the page has a recognisable "ready" element.
Will infinite-scroll pages capture all content?
By default no — we render the initial viewport. Pass ?scroll=true and we auto-scroll the page in the headless browser, triggering the lazy-load until the page stops growing. Useful for product catalogs and feed-style sites; expect higher latency proportional to total page length.
Your AI doesn't read PDFs directly. It first has to extract the text, decode the layout, ignore the metadata — before it can even start answering. A Markdown file removes all of those steps. Your AI reads it instantly. So you get faster responses, more accurate results, and zero information lost along the way.
Size-wise, it's 100 to 500 times lighter for the same content. A 15 MB PDF becomes a 30 KB .md file. So your AI knowledge base can hold hundreds of documents instead of a handful.
MDisBetter brings 19 free tools together for that — documents, videos, audio, web pages and prompts.
How does it work?
Drop a PDF, a video, an audio file or a URL. MDisBetter extracts the content and gives you a clean Markdown file. So you can send it to your AI, add it to your project files, or store it in your knowledge base — without losing anything.
Frequently Asked Questions
How do I convert a PDF to Markdown for free?
Upload your PDF to MDisBetter, click Convert, and get structured Markdown in seconds. No signup, no installation — it works directly in your browser. The free plan includes 50 credits per month.
Why is Markdown better than PDF for AI?
Markdown reduces token usage by up to 95% compared to PDF. AI models like ChatGPT and Claude process Markdown far more efficiently because it contains only content structure — no fonts, no layout data, no binary overhead.
What file types can MDisBetter convert?
MDisBetter converts PDF, Word (.docx), plain text, YouTube videos (transcript), audio files (MP3, WAV, M4A, OGG, FLAC, WEBM), and any web page URL to clean Markdown.
Is MDisBetter free?
Yes, free to start. The free plan includes 50 credits per month. All processing happens securely — your files are never stored.
Can I extract a YouTube transcript as Markdown?
Yes. Paste the YouTube video URL, click Convert, and get the full transcript structured as Markdown with headings and timestamps. Perfect for feeding video content to AI tools.
PDF → Markdown
Faithful and structured conversion of your documents
Text to MD, EPUB to MD, MD to PDF, MD Cleaner, Merger, Chunker, Token Counter, Context Builder
Free
—
Word to MD
0.5 credit
per page
Excel to MD
0.5 credit
per conversion
Single URL Scrape
0.5 credit
per call
Site Crawl
1 credit
per page
Translate
1 credit
per 10 000 chars (min 1, free re-translation on cache hit)
Prompt Optimizer
1 credit
per call
System Prompt Generator
1 credit
per call
Audio to MD
2 credits
per minute
Video to MD
2 credits
per minute
YouTube to MD
2 credits
per minute
Image OCR
4 credits
per image (0 on cache hit)
PDF to MD
4 credits
per page
PPTX to MD
4 credits
per slide
Questions
Yes! You get 50 credits every month to use any tool. Basic tools like MD Cleaner or Token Counter cost just 0.5 credit per use. When you run out, credits reset the next month or you can upgrade for more.
Wait for your monthly reset or upgrade to a higher plan. Credits renew on your billing date each month.
Yes, cancel anytime with one click. No questions asked. You keep access until the end of your billing period.
Pro gives you 30,000 credits for $29 — that's 30x more credits than Starter for just 3x the price. Every credit costs less, so you get far more value per dollar.