Smart Quotes Converter – Curly and Straight Quotation Marks
The Smart Quotes Converter moves text between two punctuation worlds. In one direction it applies publication-quality typography: straight typewriter marks become directional curly quotes, contractions get a proper apostrophe, double hyphens turn into dashes and three dots become a single ellipsis. In the other direction it flattens smart quotes back to ASCII so pasted rich text stops breaking JSON, YAML, CSV, SQL and source code. Everything runs in your browser, so nothing you paste is ever uploaded.
Why straight and curly quotes both exist
Mechanical typewriters had one key for a vertical quote, so ASCII inherited exactly two ambiguous characters: U+0022 and U+0027. Real typography has always used directional marks instead — a left double quotation mark to open a phrase and a right one to close it. Word processors auto-substitute those directional characters as you type, which is why text copied out of Word, Google Docs, Notion or a CMS carries invisible passengers into places that cannot handle them.
| Straight | Smart | Code point | Role |
|---|---|---|---|
| " | “ | U+201C | Opens a quotation |
| " | ” | U+201D | Closes a quotation |
| ' | ‘ | U+2018 | Opens a nested quotation |
| ' | ’ | U+2019 | Apostrophe or closing single quote |
-- | – — | U+2013, U+2014 | En dash and em dash |
... | … | U+2026 | Horizontal ellipsis |
How the conversion decides open from close
Naive converters simply alternate: first quote opens, second closes. That fails the moment an apostrophe appears. This tool reads the surrounding characters instead. A quote at the start of the text, after whitespace, or after an opening bracket or dash becomes an opening mark; anywhere else it becomes a closing mark. Apostrophes are resolved before quotes are even considered, using three rules:
contraction letter + ' + letter it's, don't, we're
possessive ...s + ' + non-word the girls' team
elision start + ' + word/digit 'tis, '90s, rock 'n' rollEvery one of those cases produces a right single quote, never a left one — the single most common mistake in hand-typed typography. Nested phrases are paired independently, so "He whispered 'run'" comes out with curly doubles outside and curly singles inside.
Flattening smart quotes for code and data
Going the other way is a direct code-point mapping. Curly doubles, low-9 quotes, guillemets, full-width marks and double primes all collapse to "; curly singles, primes and modifier apostrophes collapse to '; dashes become hyphens; the ellipsis becomes three dots; and no-break spaces become ordinary spaces. Turn on JSON-safe escaping and every double quote produced by the conversion is emitted as \", so a curly quote sitting inside a JSON string value no longer terminates it.
Protected regions, primes and locales
Prose and code usually live in the same document, so fenced code blocks, inline backticks, <pre> and <code> bodies, HTML attribute values and URLs are masked before any conversion runs and restored byte-for-byte afterwards. Turn on prime marks and a quote following a digit becomes a true prime instead: 5' 11" renders as 5′ 11″, which is the correct notation for feet, inches, minutes, seconds and coordinates.
Quotation conventions are not universal. German writing opens low and closes high, French uses guillemets separated by a narrow no-break space, Swedish repeats the same right-hand mark at both ends, and Japanese uses corner brackets. Pick a locale and the same contextual logic emits that language’s character set instead of the English default.
Reading the statistics
The report counts every replacement by type, lists each non-ASCII character with its code point and first position, and compares length in three units. Characters, UTF-16 code units and UTF-8 bytes diverge because a curly quote is one character but three bytes, which is exactly why “the same text” grows after smartening and why a byte-limited database column or meta description can suddenly overflow.