pipr.tools
Pipes
Clean Email Strip formatting from pasted email for clean plain text Clean AI Output Clean plain text from ChatGPT or AI output Decode & Format JWT Decode a JWT and pretty-print header and payload Word Frequency Count word frequency in text

normalize-quotes Normalize smart quotes, dashes, and ellipsis to ASCII

Aa Text
Input0 chars
Output0 chars

Flags

--mode select: full | quotes default: full

Examples

Convert curly quotes and typographic characters to ASCII

Usage
"She said “Hello” and ‘goodbye’.
The price range is $10–$20 —..." | normalize-quotes

Fix smart quotes in code pasted from Google Docs

Usage
"const msg = “Hello World”;
let name = ‘Alice’;" | normalize-quotes

Normalize text to ASCII for a plain-text email newsletter

Usage
"This week’s newsletter — Top 10 Tips…
Don’t miss our “big sa..." | normalize-quotes
View source
(input, opts = {})=>{
                const mode = opts.mode || "full";
                let out = input;
                out = out.replace(/[\u2018\u2019\u201A\u201B]/g, "'");
                out = out.replace(/[\u201C\u201D\u201E\u201F]/g, '"');
                if (mode === "full") {
                    out = out.replace(/\u2014/g, "--");
                    out = out.replace(/\u2013/g, "-");
                    out = out.replace(/\u2026/g, "...");
                    out = out.replace(/\u00A0/g, " ");
                }
                return out;
            }