Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
H

Humanizer

> 编程语言
Open source

Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities

9.8K stars0 likes0 views
WebsiteGitHub

About

Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities

Humanizer

Humanizer is a .NET library for turning strings, enums, dates, times, durations, numbers, quantities, and collections into human-friendly text.

Install

bash
dotnet add package Humanizer

Select your Humanizer version in the documentation site for version-correct package, framework, and API guidance.

Example

…

In v4 previews, applications can provide the exact noun forms for a culture's CLDR cardinal categories:

csharp
var files = new PluralizationForms(
    singular: "plik",
    other: "pliku",
    few: "pliki",
    many: "plików");

if (files.TryPluralize(5m, CultureInfo.GetCultureInfo("pl"), out var noun))
    Console.WriteLine(noun); // plików

TryPluralize uses the required cardinal rule for every supported culture and returns false when the selected form was not supplied. TrySingularize resolves any exact form in the same set. See inflection and quantities for examples.

HumanizeWithCase returns only the duration phrase; add any required preposition yourself. Singular forms may include a locale-authored one-word or article, and a locale may encode a count in the unit form. Locales and custom components without verified case support throw NotSupportedException instead of falling back to English.

V4 previews also provide opt-in decimal SI and binary IEC byte-size APIs:

csharp
var size = ByteSize.FromBytes(1_000_000);

Console.WriteLine(size.Format(ByteSizeUnitSystem.DecimalSi)); // 1 MB
Console.WriteLine(size.Format(ByteSizeUnitSystem.BinaryIec)); // 976.56 KiB

Legacy byte-size APIs keep their established unit factors. See byte sizes and rates for explicit formatting, parsing, composites, and rates.

Documentation

  • Start using Humanizer
  • Common scenarios
  • Upgrade between versions
  • Configure the migration analyzer
  • API reference

Repository

The main library is in src/Humanizer, and its xUnit tests are in tests/Humanizer.Tests. Read the contribution guide before sending a change.

Humanizer is available under the MIT license.

Support

  • Report a bug or request a feature
  • Report a documentation issue
  • Read the versioned documentation

Issues· 16 open

View all issuesOpen on GitHub
  • #1966

    Portuguese locale: incorrect `milhar` value and misspelled `milissegundo`

    Updated Sep 6, 2026
  • #1965

    humanizer

    Updated Sep 6, 2026
  • #1962

    Various non-standard and incorrect plurals are currently in use

    Updated Sep 4, 2026
  • #1959

    Dehumanize() inserts a space before trailing digits (v3 regression)

    Updated Aug 27, 2026
  • #1892

    Localized arbitrary-string Pluralize/Singularize with locale-owned grammar

    enhancementlocalisationUpdated Aug 3, 2026

> Tags

C#hacktoberfestlocalization

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言