<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Seven GS</title>
    <description>The latest articles on DEV Community by Seven GS (@seven_gs_fe6e9aff3084b6ce).</description>
    <link>https://dev.to/seven_gs_fe6e9aff3084b6ce</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4197179%2F31ca1d8c-ad4c-4a10-ad7c-bdb91ac86e54.png</url>
      <title>DEV Community: Seven GS</title>
      <link>https://dev.to/seven_gs_fe6e9aff3084b6ce</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/seven_gs_fe6e9aff3084b6ce"/>
    <language>en</language>
    <item>
      <title>How to Strip Hidden Zero-Width Characters &amp; Markdown from LLM Outputs (And Estimate BPE Tokens Locally)</title>
      <dc:creator>Seven GS</dc:creator>
      <pubDate>Mon, 26 Oct 2026 06:22:34 +0000</pubDate>
      <link>https://dev.to/seven_gs_fe6e9aff3084b6ce/how-to-strip-hidden-zero-width-characters-markdown-from-llm-outputs-and-estimate-bpe-tokens-2460</link>
      <guid>https://dev.to/seven_gs_fe6e9aff3084b6ce/how-to-strip-hidden-zero-width-characters-markdown-from-llm-outputs-and-estimate-bpe-tokens-2460</guid>
      <description>&lt;p&gt;When copying generated text, documentation, or code snippets from ChatGPT, Claude, or Gemini into a CMS, Notion, Gmail, or code editor, two recurring issues come up for developers and technical writers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Formatting &amp;amp; Invisible Unicode Artifacts:&lt;/strong&gt; Raw &lt;code&gt;**bold**&lt;/code&gt; asterisks, &lt;code&gt;###&lt;/code&gt; heading hashes, overused AI em-dashes (&lt;code&gt;—&lt;/code&gt;), broken PDF line wraps, and invisible zero-width characters (&lt;code&gt;U+200B&lt;/code&gt;, &lt;code&gt;U+FEFF&lt;/code&gt;, &lt;code&gt;U+00A0&lt;/code&gt;) that silently break string matching, regex validation, and character limits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context Window &amp;amp; Token Estimation:&lt;/strong&gt; Knowing how many Byte-Pair Encoding (BPE) tokens a long prompt, JSON payload, or multi-language document consumes before sending it to GPT-4o (128K), Claude 3.5 Sonnet (200K), or Gemini 1.5 Pro (1M)—without uploading confidential text to a third-party server.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To solve both problems with zero server round-trips, I built two new 100% client-side utilities as part of &lt;strong&gt;&lt;a href="https://textscopes.com/" rel="noopener noreferrer"&gt;TextScope&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Stripping Markdown, Em-Dashes, and Hidden Unicode Characters
&lt;/h2&gt;

&lt;p&gt;Hidden Unicode characters often sneak into copied text from rich-text editors, PDFs, and AI chat interfaces:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Unicode Point&lt;/th&gt;
&lt;th&gt;Character Name&lt;/th&gt;
&lt;th&gt;Common Issue in Production&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;U+200B&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Zero-Width Space&lt;/td&gt;
&lt;td&gt;Breaks exact string comparisons, SQL queries, and JSON keys&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;U+FEFF&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Byte Order Mark (BOM)&lt;/td&gt;
&lt;td&gt;Causes unexpected syntax errors at the start of scripts or CSVs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;U+00A0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Non-Breaking Space&lt;/td&gt;
&lt;td&gt;Prevents standard CSS word wrapping and breaks whitespace regex&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;U+2014&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Em-Dash (&lt;code&gt;—&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Overused by LLMs; makes technical and editorial copy look robotic&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With the &lt;strong&gt;&lt;a href="https://textscopes.com/ai-text-cleaner" rel="noopener noreferrer"&gt;AI Text Cleaner &amp;amp; Markdown Stripper&lt;/a&gt;&lt;/strong&gt;, you can paste any LLM or PDF output and toggle exactly what to clean locally in your browser:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strip Markdown syntax (&lt;code&gt;**bold**&lt;/code&gt;, &lt;code&gt;*italic*&lt;/code&gt;, &lt;code&gt;###&lt;/code&gt; headings, code fences, and inline links) while keeping clean paragraph breaks.&lt;/li&gt;
&lt;li&gt;Detect and remove invisible zero-width characters (&lt;code&gt;U+200B&lt;/code&gt;, &lt;code&gt;U+200C&lt;/code&gt;, &lt;code&gt;U+200D&lt;/code&gt;, &lt;code&gt;U+FEFF&lt;/code&gt;, &lt;code&gt;U+00A0&lt;/code&gt;) with an exact count of removed artifacts.&lt;/li&gt;
&lt;li&gt;Convert AI em-dashes (&lt;code&gt;—&lt;/code&gt;) and curly quotes (&lt;code&gt;“”&lt;/code&gt;) into standard ASCII punctuation.&lt;/li&gt;
&lt;li&gt;Unwrap hard single line breaks copied from multi-column PDFs without merging double-newline paragraphs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Estimating LLM Prompt Tokens &amp;amp; Context Window Headroom
&lt;/h2&gt;

&lt;p&gt;In standard English prose, &lt;code&gt;1 token ≈ 0.75 words&lt;/code&gt; (or roughly &lt;code&gt;4 characters&lt;/code&gt;), meaning &lt;strong&gt;1,000 words is ~1,330 tokens&lt;/strong&gt;. However, source code, JSON keys, Markdown tables, and CJK scripts (Japanese, Korean, Chinese) have a higher token-to-character ratio (&lt;code&gt;1.2–1.8 tokens per character&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;&lt;a href="https://textscopes.com/token-counter" rel="noopener noreferrer"&gt;LLM Prompt Token Counter &amp;amp; Words-to-Tokens Calculator&lt;/a&gt;&lt;/strong&gt; runs entirely in vanilla JavaScript and calculates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Estimated BPE token count, total words, character count, and token-to-word ratio.&lt;/li&gt;
&lt;li&gt;Real-time context window utilization across &lt;strong&gt;8K&lt;/strong&gt;, &lt;strong&gt;32K&lt;/strong&gt;, &lt;strong&gt;128K&lt;/strong&gt; (GPT-4o / Llama 3.1), &lt;strong&gt;200K&lt;/strong&gt; (Claude 3.5 Sonnet), and &lt;strong&gt;1M&lt;/strong&gt; (Gemini 1.5 Pro) limits.&lt;/li&gt;
&lt;li&gt;Single-spaced page equivalents for long-form technical docs and books.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Full Suite of Client-Side Writing &amp;amp; SEO Utilities
&lt;/h2&gt;

&lt;p&gt;All tools in the suite run 100% locally in the browser (no sign-up, no server uploads) and support 6 languages (English, Spanish, German, Portuguese, Japanese, and Korean):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://textscopes.com/" rel="noopener noreferrer"&gt;Word Counter &amp;amp; Flesch Readability Analyzer&lt;/a&gt;&lt;/strong&gt; – Real-time word/character count, Flesch Reading Ease score, Flesch-Kincaid Grade Level, and 1–3 word n-gram phrase density.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://textscopes.com/ai-text-cleaner" rel="noopener noreferrer"&gt;AI Text Cleaner &amp;amp; Format Stripper&lt;/a&gt;&lt;/strong&gt; – One-click removal of ChatGPT/Claude Markdown, em-dashes, zero-width spaces, and broken PDF line breaks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://textscopes.com/token-counter" rel="noopener noreferrer"&gt;LLM Token Counter &amp;amp; Context Calculator&lt;/a&gt;&lt;/strong&gt; – Instant words-to-tokens conversion and context window percentages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://textscopes.com/headline-checker" rel="noopener noreferrer"&gt;SEO Headline Analyzer &amp;amp; Google SERP Preview&lt;/a&gt;&lt;/strong&gt; – Title tag pixel width (&lt;code&gt;600px&lt;/code&gt;) and character length (&lt;code&gt;50–60 chars&lt;/code&gt;) checker with live search snippet preview.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://textscopes.com/reading-time" rel="noopener noreferrer"&gt;Reading &amp;amp; Speaking Time Calculator&lt;/a&gt;&lt;/strong&gt; – Converts word counts into silent reading (&lt;code&gt;200 WPM&lt;/code&gt;) and speech/presentation durations (&lt;code&gt;130 WPM&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://textscopes.com/case-converter" rel="noopener noreferrer"&gt;Case Converter &amp;amp; URL Slug Generator&lt;/a&gt;&lt;/strong&gt; – Converts text between APA Title Case, Sentence case, &lt;code&gt;camelCase&lt;/code&gt;, &lt;code&gt;snake_case&lt;/code&gt;, and clean SEO URL slugs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also check out the full multilingual documentation and reference benchmarks in the public GitHub repository: &lt;strong&gt;&lt;a href="https://github.com/GS-Seven/textscopes" rel="noopener noreferrer"&gt;GS-Seven/textscopes on GitHub&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Feedback and feature suggestions are very welcome!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Why Google Truncates Titles by 600px Pixel Width (Not 60 Characters) — And How to Measure It in Vanilla JS</title>
      <dc:creator>Seven GS</dc:creator>
      <pubDate>Wed, 21 Oct 2026 02:23:24 +0000</pubDate>
      <link>https://dev.to/seven_gs_fe6e9aff3084b6ce/why-google-truncates-titles-by-600px-pixel-width-not-60-characters-and-how-to-measure-it-in-41ed</link>
      <guid>https://dev.to/seven_gs_fe6e9aff3084b6ce/why-google-truncates-titles-by-600px-pixel-width-not-60-characters-and-how-to-measure-it-in-41ed</guid>
      <description>&lt;p&gt;Most SEO guides repeat the "50–60 character rule" for &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; tags. However, Google doesn't actually count characters when deciding where to place an ellipsis (&lt;code&gt;…&lt;/code&gt;) in desktop search results — it measures &lt;strong&gt;rendered pixel width (roughly 580–600px in 20px Arial)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A headline packed with wide uppercase letters like &lt;code&gt;W&lt;/code&gt;, &lt;code&gt;M&lt;/code&gt;, or &lt;code&gt;G&lt;/code&gt; (or full-width CJK characters in Japanese and Korean, which only fit ~28–32 characters) will truncate well before 60 characters, while narrow letters like &lt;code&gt;i&lt;/code&gt;, &lt;code&gt;l&lt;/code&gt;, and &lt;code&gt;t&lt;/code&gt; can easily fit 65+ characters.&lt;/p&gt;

&lt;h3&gt;
  
  
  Measuring Exact SERP Pixel Width in the Browser
&lt;/h3&gt;

&lt;p&gt;You don't need a heavy backend or paid SEO suite to measure title pixel width. Using an offscreen HTML5 &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt;, you can measure the exact rendered width in 4 lines of vanilla JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;canvas&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;20px Arial, sans-serif&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pixelWidth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;measureText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;headline&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Free Browser-Based Writing &amp;amp; SEO Utilities
&lt;/h3&gt;

&lt;p&gt;I built &lt;strong&gt;&lt;a href="https://textscopes.com/" rel="noopener noreferrer"&gt;TextScope&lt;/a&gt;&lt;/strong&gt;, a lightweight, 100% client-side toolkit that runs entirely in your browser without uploading drafts to any server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://textscopes.com/headline-checker" rel="noopener noreferrer"&gt;SEO Headline &amp;amp; 600px Pixel Width Checker&lt;/a&gt;&lt;/strong&gt;: Live Google SERP simulator measuring exact pixel width (&lt;code&gt;px / 600px&lt;/code&gt;), meta description length (&lt;code&gt;920–960px&lt;/code&gt;), and CTR power words.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://textscopes.com/" rel="noopener noreferrer"&gt;Text Analyzer &amp;amp; 1–3 Word Phrase Density Checker&lt;/a&gt;&lt;/strong&gt;: Instant word count, Flesch Reading Ease, Flesch-Kincaid grade level (ideal for B2B cold emails and newsletters), and N-gram keyword frequency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://textscopes.com/reading-time" rel="noopener noreferrer"&gt;Reading &amp;amp; Speech Time Calculator&lt;/a&gt;&lt;/strong&gt;: Convert word counts to silent reading time (200 WPM), speech/podcast timing (130–150 WPM), YouTube script budgets, and page counts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://textscopes.com/case-converter" rel="noopener noreferrer"&gt;Smart Title Case &amp;amp; SEO URL Slug Converter&lt;/a&gt;&lt;/strong&gt;: Convert headings between APA/Chicago Title Case, Sentence case, and clean &lt;code&gt;kebab-case&lt;/code&gt; URL slugs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All tools support English, Spanish, German, Portuguese, Japanese, and Korean out of the box. Feedback is welcome!&lt;/p&gt;

</description>
      <category>seo</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>writing</category>
    </item>
  </channel>
</rss>
