• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
dpip

dpip

graphemeCounter

Public
Like
3
graphemeCounter
Home
Code
4
backend
1
frontend
2
shared
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
6/30/2025
Viewing readonly version of main branch: v8
View latest version
README.md

Grapheme Counter

A simple React web application that accurately counts graphemes in text, including emojis and complex characters.

Features

  • Real-time grapheme counting using Intl.Segmenter for accurate results
  • Multiple text statistics: graphemes, characters, and words
  • Example texts to demonstrate complex grapheme counting
  • Modern UI with TailwindCSS styling
  • Responsive design that works on all devices

What are Graphemes?

Graphemes are the smallest units of a writing system. They can be:

  • Single characters (like "a", "b", "c")
  • Emojis (like "✉️", "👋")
  • Combining characters (like "é" which can be "e" + "́")
  • Complex sequences (like "👨‍👩‍👧‍👦" which is a family emoji)

For example, "abc✉️" contains 4 graphemes: "a", "b", "c", and "✉️".

Technical Details

  • Frontend: React 18.2.0 with TypeScript
  • Backend: Hono server for serving the app
  • Styling: TailwindCSS
  • Grapheme Counting: Uses Intl.Segmenter with granularity: 'grapheme'
  • Platform: Built for Val Town

Project Structure

├── backend/
│   └── index.ts              # Hono server entry point
├── frontend/
│   ├── components/
│   │   └── App.tsx           # Main React component with all logic
│   ├── index.html            # HTML template
│   └── index.tsx             # React entry point
└── README.md

Usage

  1. Enter text in the textarea
  2. View real-time statistics:
    • Graphemes: The number of visual units
    • Characters: The total character count
    • Words: The number of words
  3. Try the example texts to see complex grapheme counting in action

Example Results

TextGraphemesCharactersWords
"abc✉️"461
"Hello World! 👋"13152
"café 🍵"682
"👨‍👩‍👧‍👦"171

Browser Compatibility

The app uses Intl.Segmenter which is supported in:

  • Chrome 87+
  • Firefox 102+
  • Safari 15+
  • Edge 87+

For older browsers, it falls back to character counting.

Development

This is a Val Town project. The main entry point is backend/index.ts which serves the React application.

To run locally with Deno:

deno run --allow-net --allow-read backend/index.ts
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.