A character-based tokenization application built with Next.js , featuring bidirectional text-to-token and token-to-text conversion capabilities.
- 🔤 Text Tokenization: Convert any text input into numerical tokens
- 🔢 Token Decoding: Convert token arrays back to readable text
- 🌍 Extended Character Support: Handles ASCII, extended Latin characters, and special symbols
- 📊 Character Mapping Viewer: Interactive display of all character-to-token mappings
- 📱 Responsive Design: Modern, mobile-friendly interface with glassmorphism effects
- ⚡ Real-time Processing: Instant conversion with loading states and error handling
- 📋 Copy & Download: Export results in multiple formats
- 🎨 Consistent Theming: Unified color scheme and design system
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Icons: Lucide React
- State Management: React Hooks
- Architecture: Component-based with server/client separation
src/
├── app/ # Next.js app directory
│ ├── layout.tsx # Root layout with metadata
│ ├── page.tsx # Server component entry point
│ └── globals.css # Global styles
├── components/ # Reusable UI components
│ ├── Header.tsx # Application header
│ ├── ModeToggle.tsx # Mode switching buttons
│ ├── InputSection.tsx # Input forms
│ ├── OutputSection.tsx # Results display
│ ├── StatsSection.tsx # Statistics panel
│ ├── ViewMappingButton.tsx # Character mapping button
│ ├── CharacterMappingModal.tsx # Character mapping modal
│ └── TokenizerInterface.tsx # Main interface component
└── utils/ # Utility functions
├── constants.ts # Design system constants
└── tokenizer.ts # Core tokenization logic
-
Clone the repository
git clone https://github.com/yourusername/tokenizer.git cd tokenizer -
Install dependencies
npm install # or yarn install # or pnpm install
-
Run the development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser Navigate to http://localhost:3000
- Select "Text → Token" mode
- Enter your text in the input field
- Click "Tokenize Text"
- View the generated token array in the output section
- Select "Token → Text" mode
- Enter tokens in array format:
[1, 2, 3] - Click "Convert to Text"
- View the decoded text in the output section
- Click "View Character Mapping" to see all character-to-token mappings
- Browse through the interactive grid of characters and their token IDs
- Each mapping shows the character, token number, and Unicode code
- Built with Next.js
- Styled with Tailwind CSS
- Icons from Lucide React
- Fonts from Geist
If you have any questions or need help:
- 📧 Email: your-email@example.com
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
Made with ❤️ by [Mantu Kumar]