How to Type Hindi in Notepad and Text Editors
How to type Hindi in Notepad, Notepad++, Sublime Text, VS Code, and other plain text editors — covering input setup, encoding settings, and font configuration.
Notepad doesn't look like it'd have any problems with Hindi. It's the simplest text editor on Windows — how hard can it be? But I can't count the number of times someone has typed Hindi in Notepad, saved the file, opened it again, and found garbled characters staring back at them.
The issue isn't Notepad's ability to accept Hindi input. That part works fine. The problem is encoding — how the file stores those Hindi characters on disk. Get the encoding right and everything works perfectly. Get it wrong and your text becomes a sequence of question marks and accented Latin characters.
Here's how to type Hindi correctly in Notepad and several other popular text editors, with the encoding pitfalls handled upfront.
Typing Hindi in Windows Notepad
Prerequisites
You need Hindi input configured on Windows:
- Settings → Time & Language → Language & Region → Add a Language → Hindi (India)
- Choose Hindi Phonetic keyboard if you want transliteration-style typing
- Switch between English and Hindi with Win + Spacebar
Typing
- Open Notepad
- Press Win + Spacebar to switch to Hindi
- Start typing — Devanagari text appears immediately
- The IME suggestion popup shows alternatives as you type (if using phonetic input)
- Press Spacebar to accept the top suggestion or number keys to pick alternatives
Saving with the Correct Encoding
This is the critical step. When saving your file:
- File → Save As
- Next to "Encoding," select UTF-8 (or UTF-8 with BOM)
- Give it a filename and save
Opening Existing Hindi Text Files
If you open a text file with Hindi content and it looks like garbled characters:
- Close the file
- Reopen with File → Open
- Change the "Encoding" dropdown (bottom of the dialog) to UTF-8
- Click Open
Notepad's Font
Notepad's default font (Consolas or Lucida Console on older Windows) supports basic Devanagari rendering. But if Hindi text looks cramped or some characters look wrong, change the font:
- Format → Font (or Settings → Font in newer Notepad)
- Select Nirmala UI or Noto Sans Devanagari
- These fonts render Devanagari glyphs, matras, and conjuncts properly
Typing Hindi in Notepad++
Notepad++ is the most popular free text editor on Windows, and it handles Hindi much better than plain Notepad — primarily because of its robust encoding support.
Setup
- Make sure Hindi input is enabled on your system (same Win + Spacebar setup)
- Open Notepad++
- Before typing any Hindi, set the encoding: Encoding → Encode in UTF-8
Typing Hindi
Switch to Hindi input (Win + Spacebar), type in the editor. Hindi text appears normally.
Encoding Verification
The current encoding is always visible in the bottom status bar of Notepad++. It should say "UTF-8" or "UTF-8-BOM." If it says "ANSI," your Hindi text will be corrupted on save. Change it via Encoding → Convert to UTF-8.
Important distinction: "Encode in UTF-8" sets the encoding for new content. "Convert to UTF-8" re-encodes existing content from its current encoding to UTF-8. If you already typed Hindi in ANSI mode, you need "Convert" to fix the existing text.Font Configuration
Settings → Style Configurator → Global Styles → Default Style → Font name.
Set to Nirmala UI, Consolas (which has Devanagari fallback on modern Windows), or Noto Sans Devanagari.
You can also set the font size here. For Hindi text, sizes 12-14pt are more readable than the typical 10pt used for code.
Syntax Highlighting with Hindi
If you're editing HTML, XML, or Markdown files that contain Hindi text, Notepad++ handles syntax highlighting correctly — the Hindi content inside tags or markup is rendered without interfering with the highlighting.
Typing Hindi in VS Code
Visual Studio Code is increasingly popular even among non-developers — writers, students, and content creators use it for its markdown support and versatility.
Hindi Input
VS Code accepts Hindi input from the Windows system keyboard without any additional configuration. Switch to Hindi (Win + Spacebar), type in the editor. Works in any file type — .txt, .md, .html, .json, anything.
Encoding
VS Code defaults to UTF-8, which is perfect for Hindi. You can verify and change encoding by clicking the encoding indicator in the bottom status bar (usually says "UTF-8").
If you open a file with garbled Hindi, click the encoding indicator → "Reopen with Encoding" → select UTF-8.
Font Configuration
Open Settings (Ctrl + ,) and search for "font family." The default editor font is typically Consolas or a monospace font. For mixed English-Hindi editing, add a Devanagari font as a fallback:
"editor.fontFamily": "Consolas, 'Nirmala UI', monospace"
This tells VS Code to use Consolas for Latin characters and fall back to Nirmala UI for Devanagari. Both scripts render cleanly side by side.
Markdown Preview with Hindi
If you write Hindi in Markdown files (.md), the built-in preview (Ctrl + Shift + V) renders Devanagari text correctly. This is handy for drafting Hindi blog posts, documentation, or notes in Markdown format.
Typing Hindi in Sublime Text
Sublime Text has a known quirk with IME (Input Method Editor) input. Hindi typing works but the composition window might appear in an odd position or lag slightly.
Setup
- Ensure Hindi input is enabled on your system
- Open Sublime Text
- Set encoding: File → Save with Encoding → UTF-8
Font
Preferences → Settings → add to user settings:
{
"font_face": "Nirmala UI",
"font_size": 13
}
Or if you want a monospace font for code with Hindi support, use the font fallback approach in your preferences.
Known Issues
Sublime Text's IME handling on Windows is less polished than VS Code's. The transliteration suggestion popup might not position correctly, and there can be a slight delay between typing and character rendering. If this bothers you, type Hindi content in another editor or at transliterate.in and paste into Sublime Text.
Typing Hindi in Vim / Neovim
For terminal-based editors, Hindi typing depends on the terminal emulator and the input framework.
In Windows Terminal
- Switch to Hindi input (Win + Spacebar)
- Open Vim or Neovim
- Enter insert mode (press
i) - Type Hindi — it should work if Windows Terminal's font supports Devanagari
Font for Windows Terminal
In Windows Terminal settings, set the font to one that covers Devanagari. "Cascadia Code" (the default) has limited Devanagari support. Better options:
- Set the font to "Nirmala UI" for full Devanagari support (though it's not monospace)
- Or configure a font fallback in the terminal settings JSON
Encoding in Vim
Set UTF-8 encoding in your vimrc or init.vim:
set encoding=utf-8
set fileencoding=utf-8
This ensures Hindi text is saved correctly.
The Universal Fallback: Transliterate and Paste
For any text editor — no matter how niche or old — the copy-paste method always works:
- Open transliterate.in in your browser
- Type in English: "yah ek pariksha hai"
- Get Hindi: यह एक परीक्षा है
- Copy (Ctrl + C)
- Paste into your text editor (Ctrl + V)
- Save with UTF-8 encoding
Encoding Deep Dive: Why Hindi Text Gets Corrupted
Understanding encoding helps prevent and fix corrupted Hindi text.
What is UTF-8?
UTF-8 is a character encoding that can represent every character in the Unicode standard, including all Devanagari characters, Tamil, Bengali, Telugu — every Indian script. Each Hindi character like अ is stored as a specific byte sequence (in this case, E0 A4 85).
What is ANSI?
ANSI (Windows-1252 on Western systems) is a legacy encoding that only supports 256 characters — basically English and some Western European characters. Devanagari characters don't exist in ANSI. When you save Hindi text as ANSI, each Hindi character gets replaced with whatever garbage the encoder can fit into one byte.
What is UTF-16?
Another Unicode encoding. Some older Windows applications and APIs use UTF-16 internally. Notepad offers "UTF-16 LE" and "UTF-16 BE" as encoding options. These work fine for Hindi but are less standard than UTF-8 for text files. Stick with UTF-8 unless you have a specific reason.
BOM (Byte Order Mark)
"UTF-8 with BOM" adds a special invisible character at the beginning of the file that signals the encoding. Some applications need this marker to correctly identify UTF-8. Others (especially on Linux) don't expect it and might display a weird character at the file's start. For maximum compatibility, "UTF-8" without BOM is the safest default.
Batch Fixing Encoding in Multiple Files
If you have many text files with corrupted Hindi text (all saved in the wrong encoding), you can batch-convert them:
In Notepad++
- Open the file with garbled text
- Encoding → select the original encoding the file was saved in (try UTF-8, if garbled try other options)
- Once text displays correctly, Encoding → Convert to UTF-8
- Save
In VS Code
- Open the file
- Click the encoding indicator in the status bar
- "Reopen with Encoding" → try different options until Hindi text displays correctly
- Then "Save with Encoding" → UTF-8
Practical Tips
- Always check encoding before typing Hindi — take one second to verify UTF-8 is set. This saves hours of frustration.
- Use Nirmala UI as your editor font — it handles both English and Hindi in the same document better than any other single font.
- For filenames in Hindi — Windows supports Hindi filenames (saved as UTF-16 internally by NTFS). But not all applications handle Hindi filenames well. For maximum compatibility, keep filenames in English and put Hindi content inside the file.
- When sharing text files — if the recipient sees garbled text, the first thing to check is encoding. Tell them to open the file with UTF-8 encoding specified.
- Plain text vs rich text — for Hindi, plain text (.txt) with UTF-8 encoding is more portable and less error-prone than rich text (.rtf). Rich text files can embed font information, but the font dependency creates its own problems.