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

word-freq Word frequency analysis

# Stats
Input0 chars
Output0 chars

Examples

Find most frequent words in a sentence

Usage
"the cat sat on the mat and the cat purred" | word-freq

Spot overused keywords in landing page copy for SEO

Usage
"Buy our premium widget today. This premium product offers pr..." | word-freq

Find repetitive words in a draft before editing

Usage
"The project requires careful planning. The team needs more r..." | word-freq
View source
(input)=>{
                const freq = {};
                input.toLowerCase().split(/[^a-zA-Z0-9']+/).filter((w)=>w.length > 1).forEach((w)=>(freq[w] = (freq[w] || 0) + 1));
                return Object.entries(freq).sort((a, b)=>b[1] - a[1]).slice(0, 30).map(([w, n])=>`${w.padEnd(20)} ${String(n).padStart(5)}`).join("\n");
            }

Also useful for