Replace Smart Quotes

Replace curly smart quotes with straight ASCII quotes instantly. Clean up typographic characters from Word or Mac that cause issues in code, data files, and plain text.

What Smart Quotes Are and Why They Cause Problems

Smart quotes are typographic quotation marks that curve or point in a specific direction to indicate the opening or closing of a quoted passage. Most word processors and operating systems insert them automatically when you type a straight quote character. While they look better in printed and formatted text, they create serious problems when that text is used in technical contexts such as code, configuration files, data exports, and databases. This tool replaces all smart typography characters with their plain ASCII equivalents in one click. For cleaning up other formatting issues in the same text, the remove line breaks tool handles line ending cleanup and the remove white spaces tool strips extra whitespace.

Smart Quotes vs Straight Quotes

Straight quotes are the standard ASCII characters: the double quote " (U+0022) and the single quote or apostrophe ' (U+0027). Smart quotes are Unicode characters that come in pairs: the left double quotation mark " (U+201C), the right double quotation mark " (U+201D), the left single quotation mark ' (U+2018), and the right single quotation mark or typographic apostrophe ' (U+2019). Microsoft Word, Google Docs, Apple Pages, and most modern operating systems convert straight quotes to smart quotes automatically as you type, using contextual rules to determine which direction each quote should curve.

Why Smart Quotes Cause Problems

Smart quotes cause problems because they are multi-byte Unicode characters rather than the single-byte ASCII characters that most programming languages, data formats, and legacy systems expect. When you paste code from a blog post or document editor into a terminal or code editor, smart quotes may appear identical on screen but cause syntax errors at runtime. JSON parsers reject files that contain smart quotes around keys or values. CSV files with smart-quoted fields confuse spreadsheet applications that expect standard ASCII delimiters. Command-line tools fail when arguments are wrapped in curly quotes instead of straight ones. Shell scripts break when string literals contain typographic apostrophes. Replacing smart quotes before using the text in any technical context prevents all of these issues.

Convert Curly Quotes to Straight Quotes Instantly

The instant tool on this page processes your text entirely in the browser. Nothing is sent to a server. The replacement happens in milliseconds regardless of how long your text is, and you can see a count of every character type that was replaced so you know exactly what changed. For more complex cleanup that also involves rewriting, paraphrasing, or correcting grammar in addition to quote replacement, use the AI chat panel on the left.

How to Replace Smart Quotes in 5 Steps

1

Paste Your Text

Copy text from Word, Google Docs, a web page, email, or any source that uses smart typography, and paste it into the textarea.

2

Select Your Replacements

Check or uncheck the character types you want to replace. By default all five types are selected: double quotes, single quotes, em dashes, en dashes, and ellipsis.

3

Click Replace Quotes Now

The cleaned text appears instantly with a count of how many replacements were made for each character type.

4

Review the Result

Check the output to confirm the replacements look correct. The count summary tells you exactly what changed.

5

Copy and Use

Click the Copy button to copy the cleaned text to your clipboard and paste it into your code editor, terminal, database, or data file.

Replacement Options

The tool offers five independent replacement options. Double smart quotes converts the opening curly double quote and closing curly double quote to the standard straight double quote character. Single smart quotes converts the typographic left single quotation mark and right single quotation mark, including the apostrophe variant, to a standard single quote. Em dashes converts the long dash character used in formal writing to two consecutive hyphens, which is the standard ASCII representation. En dashes converts the medium-length dash used in date ranges and number ranges to a single hyphen. Ellipsis converts the single ellipsis character to three individual periods. Each option can be enabled or disabled independently so you can preserve some typographic characters while replacing others.

Fixing Code, CSV Files, and Database Imports

The most common reason to replace smart quotes is preparing text for technical use. Code, data interchange formats, and database systems all require plain ASCII characters for string delimiters, and smart quotes break all of them in ways that can be difficult to diagnose because the problematic characters look almost identical to the correct ones on screen.

Fixing Code Copied from Word

Code examples in Word documents, PowerPoint presentations, PDFs, and blog posts frequently contain smart quotes instead of straight quotes because the authoring tool converted them automatically. When you copy this code and paste it into a code editor or terminal, the smart quotes cause syntax errors in most programming languages. Python raises a SyntaxError. JavaScript throws an unexpected token error. SQL queries fail with invalid character errors. Bash scripts produce command not found errors when the shell cannot parse the string. Running the text through this tool before pasting code into a technical environment prevents all of these issues. For deeper code review and fixing, the AI code converter can help translate or refactor code while also cleaning up character issues. To further check your code or text for errors after cleaning, try our AI writing checker.

Cleaning Data for CSV and JSON

CSV files use standard double quote characters to wrap fields that contain commas or line breaks. Smart curly quotes in those fields break CSV parsers because the parser cannot identify where the field starts and ends. The same problem occurs in JSON: the JSON specification requires standard ASCII double quotes for string delimiters and keys, and any Unicode quotation mark in their place causes a parse error. When preparing data that originated in Word, Notion, or Google Docs for export to CSV or JSON, replacing smart quotes first ensures the output file parses correctly. After cleaning, you can use our replace text online tool to make any additional text substitutions before finalizing the file.

Preparing Text for Databases

Database import tools and ORM frameworks handle standard ASCII quotes predictably through escaping and parameterized queries. Smart quotes, however, are multi-byte Unicode sequences that may cause character encoding errors when inserted into databases that use single-byte or Latin-1 encoding. Even in UTF-8 databases, smart quotes in string values can interfere with full-text search indexes, comparison operators, and pattern matching queries that expect ASCII quote characters as delimiters. Stripping smart quotes from imported content before it reaches the database prevents encoding mismatches and search inconsistencies that are otherwise time-consuming to diagnose. For content that also needs grammar and phrasing improvements before import, use our grammar checker in combination with this tool.

Em Dashes, En Dashes, and Ellipsis Characters Too

Smart quotes are the most common problematic typography characters, but they are not the only ones that cause issues in technical contexts. Word processors and design tools also insert em dashes, en dashes, and ellipsis characters automatically in place of their simpler ASCII equivalents. This tool handles all five character types in a single pass, so you do not need to run separate cleanup steps for each.

Replacing All Smart Quotes

The tool covers all Unicode variants of smart quotation marks, not just the most common ones. This includes the double low-9 quotation mark used in some European languages, the reversed double prime quotation mark, and the heavy double turned comma quotation mark used in decorative contexts. Single quote variants covered include the single low-9 quotation mark and the single reversed comma quotation mark. By targeting all Unicode code points in these character families, the tool ensures complete cleanup regardless of which word processor or locale setting produced the characters in your source text. After replacement, your text will use only standard ASCII quote characters compatible with any technical environment.

Fixing Em Dashes and Ellipsis

The em dash (U+2014) is inserted automatically by Word and many other editors when you type two consecutive hyphens. In technical contexts, a double hyphen -- is the standard representation for comments in SQL, and shell scripts and command-line tools often use double hyphens for long option flags. The ellipsis character (U+2026) is a single Unicode character that represents three dots. In programming, pattern matching, and file glob expressions, three separate period characters are expected rather than the single ellipsis character. Replacing both ensures that punctuation copied from formal writing or document editors works correctly in any technical application. For text that also needs reformatting after cleaning, the auto break text into paragraphs tool can add paragraph structure back to cleaned text.

Cleaning Code Snippets

Code snippets shared in blog posts, tutorials, documentation PDFs, and presentation slides often contain smart typography because the document authoring tool applied autocorrect. A common scenario is a tutorial that shows a Python string like print("hello") but with curly double quotes around hello instead of straight ones. When a reader copies this snippet and runs it, Python cannot parse the string literal and throws a SyntaxError at the quote character. The same issue occurs with JavaScript template literals, shell command strings, SQL WHERE clauses, and configuration file values. Pasting any code through this tool before using it is a good habit when the source is a word processor, a formatted PDF, or a web page that uses smart typography. The HTML to text converter is a useful companion tool when the code is embedded in HTML and you need to strip tags before cleaning the typography. For full text analysis after cleaning, use the AI text analyzer.

Frequently Asked Questions

What are smart quotes?

Smart quotes are typographic quotation marks that curve to indicate the direction of the quotation. The opening double smart quote curves to the left (“) and the closing one curves to the right (”). The same applies to single smart quotes (‘ and ’). Word processors like Microsoft Word and Google Docs insert them automatically when you type a straight quote character. They are also called curly quotes or typographic quotes. While they look more refined in formatted text, they are Unicode characters that cause errors in code, data files, and any system that expects standard ASCII straight quotes.

Do smart quotes cause errors in code?

Yes. Most programming languages define string literals using ASCII straight quote characters. When smart quotes appear in code, the parser cannot recognize them as string delimiters and throws a syntax error. Python, JavaScript, PHP, Ruby, Shell, SQL, and nearly every other language are affected. The problem is especially common when code is copied from blog posts, PDFs, Word documents, or slide decks that applied smart quote autocorrect. The error message may not always identify the quote character as the cause, making these bugs difficult to spot without specifically looking for Unicode quote characters.

Does it replace both single and double quotes?

Yes. The tool handles all four smart quote characters independently: the left double quotation mark (“), the right double quotation mark (”), the left single quotation mark (‘), and the right single quotation mark and typographic apostrophe (’). It also covers less common variants such as the double low-9 quotation mark and the heavy double turned comma quotation mark. You can enable or disable double and single quote replacement independently using the checkboxes, which is useful when you need to preserve one type while replacing the other.

Does it handle em and en dashes?

Yes. The tool replaces em dashes (—) with double hyphens (--) and en dashes (–) with single hyphens (-). These are the standard ASCII representations used in programming, command-line tools, and plain text. Em dashes and en dashes are Unicode characters that cause the same types of problems as smart quotes when they appear in code, configuration files, or data. Both options can be toggled independently so you can replace dashes without affecting quotes, or vice versa.

Where do smart quotes come from?

Smart quotes come from autocorrect and autoformat features in word processing software. Microsoft Word, Google Docs, Apple Pages, LibreOffice Writer, and most modern text editors convert straight quotes to smart quotes automatically as you type. Mac operating systems also insert smart quotes system-wide through the Keyboard settings. When text is copied from any of these sources and pasted into a technical environment, the smart quotes come along for the ride. Email clients, blog editors, and content management systems with rich text formatting also frequently apply smart quotes when you compose or paste text into them.

What is smart quotations?

Smart quotations is another term for smart quotes, referring to the typographic quotation marks automatically inserted by word processors and operating systems. The term distinguishes them from straight or dumb quotes, which are the plain ASCII characters. Smart quotations include the paired left and right versions of both double and single quote characters. While they improve the visual quality of typeset text, they are incompatible with most technical uses and need to be replaced with straight quotes before the text can be used in code, data files, or any ASCII-dependent context.

What is remove quotes?

Remove quotes generally refers to stripping quotation marks from text, either to clean up formatting or to extract the content inside quoted strings. This tool does not remove quotes entirely but replaces typographic smart quotes with standard ASCII straight quotes. If you need to remove all quotation marks from text, you can use our replace text online tool to find and replace both single and double quote characters with nothing. The AI chat panel on this page can also perform custom removal tasks based on your specific requirements.

Related Tools