RussianTransliterator 1.1.0
dotnet add package RussianTransliterator --version 1.1.0
NuGet\Install-Package RussianTransliterator -Version 1.1.0
<PackageReference Include="RussianTransliterator" Version="1.1.0" />
<PackageVersion Include="RussianTransliterator" Version="1.1.0" />
<PackageReference Include="RussianTransliterator" />
paket add RussianTransliterator --version 1.1.0
#r "nuget: RussianTransliterator, 1.1.0"
#:package RussianTransliterator@1.1.0
#addin nuget:?package=RussianTransliterator&version=1.1.0
#tool nuget:?package=RussianTransliterator&version=1.1.0
Russian Transliterator
A small .NET library (NuGet package) that converts Russian Cyrillic text to Latin letters.
Привет, мир! -> Privet, mir!
Use it for URLs, file names, logins, email addresses, search and any place where only Latin letters are allowed.
Why this library
- Correct letter case. One Russian letter can become several Latin letters (
Щ→Shch). The library looks at the word and chooses the right case, so you getSHCHUKA, notShchUKA. - Fast and saves memory. It reads the text only once. A text without Russian letters is returned as is, without new memory.
- Very small. One class, about 9 KB, no dependencies.
- Works everywhere. It targets .NET Standard 2.0: .NET 5 and newer, .NET Core 2.0+, .NET Framework 4.6.1+, Mono, Unity and more.
- Same result on every computer. The result does not depend on the current culture of the system.
- Safe for other text. Numbers, Latin letters, punctuation, emoji and letters of other alphabets stay unchanged.
How the letter case works:
| Text | Russian Transliterator | Simple letter replacement |
|---|---|---|
Щука |
Shchuka |
Shchuka |
ЩУКА |
SHCHUKA |
ShchUKA |
Журнал «ЖИЗНЬ» |
Zhurnal «ZHIZN» |
Zhurnal «ZhIZN» |
Я ЛЮБЛЮ ЧАЙ |
YA LYUBLYU CHAY |
Ya LYuBLYu ChAY |
Installation
dotnet add package RussianTransliterator
Or in the Package Manager Console in Visual Studio:
Install-Package RussianTransliterator
Usage
using RussianTransliteration;
var latin = RussianTransliterator.ToLatin("Какой-нибудь русский текст");
// or as an extension method
var latin = "Какой-нибудь русский текст".ToLatin();
Examples
| Russian | Latin |
|---|---|
Яга |
Yaga |
ЖКХ |
ZHKH |
Белый |
Belyy |
Василий |
Vasily |
Бийск |
Biysk |
Труха |
Truha |
Вверх |
Vverkh |
деревья |
derevya |
сверхъестественное |
sverkhestestvennoe |
iPhone в Минске |
iPhone v Minske |
Отчёт_за_Январь_2026.docx |
Otchet_za_Yanvar_2026.docx |
Rules
| Russian | Latin | Russian | Latin | Russian | Latin |
|---|---|---|---|---|---|
| а | a | к | k | х | kh |
| б | b | л | l | ц | ts |
| в | v | м | m | ч | ch |
| г | g | н | n | ш | sh |
| д | d | о | o | щ | shch |
| е | e | п | p | ъ | |
| ё | e | р | r | ы | y |
| ж | zh | с | s | ь | |
| з | z | т | t | э | e |
| и | i | у | u | ю | yu |
| й | y | ф | f | я | ya |
Special rules:
ъandьare removed:Объявление→Obyavlenie.хafter a vowel or afterкbecomesh:Труха→Truha,ЖКХ→ZHKH.ийat the end of a word becomesy:Василий→Vasily, butБийск→Biysk.
Benchmarks
Time and memory for one ToLatin call, measured with BenchmarkDotNet on AMD Ryzen 7 7800X3D:
| Text | Characters | .NET 10 | .NET Framework 4.8 | Memory |
|---|---|---|---|---|
Как выбрать тариф ЖКХ в 2026 году: советы и примеры |
51 | 104.62 ns | 218.02 ns | 320 B |
КАК ВЫБРАТЬ ТАРИФ ЖКХ В 2026 ГОДУ: СОВЕТЫ И ПРИМЕРЫ |
51 | 123.62 ns | 327.82 ns | 320 B |
Архив ЮРИДИЧЕСКИЙ отдел ЖКХ Щёлково ОХРАНА ТРУДА Счета и ПЛАТЁЖ за Январь–Июнь 2026 (Шаблоны ЦЕНЫ v2) ИТОГОВЫЙ.zip |
114 | 304.44 ns | 717.22 ns | 600 B |
How to choose a utility tariff in 2026: tips and examples |
57 | 18.78 ns | 24.53 ns | 0 B |
| The full text of the novel "War and Peace" | 3,606,380 | 15.07 ms | 20.32 ms | 14.9 MB |
To run the benchmarks yourself:
# short texts
dotnet run -c Release -f net10.0 --project benchmarks/RussianTransliterator.Benchmarks -- --filter "*ToLatinBenchmarks*"
# "War and Peace"
dotnet run -c Release -f net10.0 --project benchmarks/RussianTransliterator.Benchmarks -- --filter "*BookBenchmarks*"
License
MIT-0: you can use this library for free in any project, including commercial ones, and you don't need to mention the author.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.