Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

iconv-lite

Read and write text in older encodings.

UtilitiesNPM

GitHubWebsite

1. License

“to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software”

MIT allows use in paid and closed-source products.

github.com/pillarjs/iconv-lite/blob/v0.7.3/LICENSE

From the package registry and GitHub, checked daily; card checked Nov 10, 2026. Tap a verdict to see its source.How we checkedReport an error

What iconv-lite does

iconv-lite is a free JavaScript library that turns text saved in older character sets, such as Windows-1252, Shift_JIS or GBK, into normal text your app can show, and back. Without it, such files show up as question marks and broken symbols. It is plain JavaScript, so nothing has to be compiled when you install it.

What people build with it

Open files from older programs

A customer uploads a price list saved by an old Windows or Japanese office program; your app shows the names correctly instead of broken symbols.

Send files to an older system

A bank, shop till or warehouse system only accepts files in its own character set; your app writes the export in exactly that set.

Accept form posts in other encodings

A server receives form posts or callbacks from older systems that are not in UTF-8 and reads them correctly; the popular Express body reader relies on it.

Convert large files piece by piece

A nightly job turns big old exports into UTF-8 without loading the whole file into memory at once.

Scrape pages in older encodings Idea

A scraper fetches a Japanese or Chinese page that declares Shift_JIS or GBK and turns the raw bytes into readable text before parsing it.

iconv-lite popularity

62 / 100
Gid Score, #891 overall
449M
downloads a week, npm
3,186
GitHub stars
10
agent projects use it
iconv-lite: downloads per weeknpm, iconv-lite 449,417,679
iconv-lite: GitHub starspillarjs/iconv-lite 3,186

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How iconv-lite is used

  • iconv-lite is a dependency in 10 of the 6,258 public GitHub projects set up for AI coding agents that we scanned, too few to describe it from them alone. Our scan also samples projects by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750); counting those, it appears in 31 projects, and what it is used with below comes from all of them.
  • Projects that use it most often also use Zod (77.4%), Vitest (67.7%), Vite (64.5%).

By coding agent

7 projects, 0.2%
5 projects, 0.2%
5 projects, 1.5%

Often used with

In 77.4% of its projects
In 67.7% of its projects
In 64.5% of its projects
In 54.8% of its projects
In 54.8% of its projects
In 45.2% of its projects
In 38.7% of its projects

More about iconv-lite

Funding
  • Open Collective: https://opencollective.com/express

See all

More in Utilities

Alternatives

iconv-lite This page

MITGid 62449M/wk

jschardet

Pick jschardet when you first need to guess which character set a file uses; iconv-lite then converts it.

charset-normalizer

Pick charset-normalizer when your code is in Python and you want the set detected and the text decoded in one step.

ftfy

Pick ftfy when the text was already decoded wrongly into broken symbols and you need to repair it in Python.

Compare iconv-lite with another tool

Get started

Tell your AI assistant

“Use the npm package iconv-lite (pin iconv-lite@0.7.3) to read the uploaded file as raw bytes and decode it with iconv.decode(bytes, 'windows-1252'), then save UTF-8; do not read the file as 'utf8' first.”

  1. Add the stable version (0.7.x) to your project; it works with require in any Node.js version.

    npm install iconv-lite@0.7.3

    From registry.npmjs.org/iconv-lite

  2. Decode bytes into text, or encode text into bytes, naming the character set.

    var iconv = require('iconv-lite');
    
    // Convert from an encoded buffer to a js string.
    str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');
    
    // Convert from a js string to an encoded buffer.
    buf = iconv.encode("Sample input string", 'win1251');
    

    From github.com/pillarjs/iconv-lite/blob/v0.7.3/README.md

Mistakes to avoid

fs.readFileSync('old.csv', 'utf8') and then iconv.decode(text, 'windows-1252')
fs.readFileSync('old.csv') (no encoding, so you get a Buffer) and then iconv.decode(bytes, 'windows-1252')

Reading as UTF-8 first already destroys the bytes; decode needs the raw Buffer.

Copying import iconv from 'iconv-lite' and the Node.js 22 setup from the GitHub front page into a project on 0.7.3, or upgrading to 1.0 while keeping require('iconv-lite')
Stay on iconv-lite@0.7.3 with require, or move to 1.0 together with ES module imports and Node.js 22+

The main-branch README already describes 1.0, where require is no longer a supported entry point.

Expecting iconv.encode('Café 世界', 'ascii') to give 'Cafe ...' style replacements
Pick a target set that has the characters, or replace them yourself before encoding

Missing characters become ? (our run turned 'Hello 世界' in latin1 into 'Hello ??').

Expecting iconv.encode(text, 'utf8') output to start with a byte order mark
Pass { addBOM: true } when the receiving program needs one

No BOM is written unless you ask for it.

Calling iconv.decodeStream in React Native without a stream module
Install a stream module first, as the README says, or use the one-shot decode

The streaming API needs the stream module, which React Native does not ship.

Questions

Can I use it in a paid, closed-source app?

Yes. It is MIT licensed; keep the copyright and license notice with the package.

Why do I still get broken symbols after decoding?

Most often the file was first read as UTF-8 text, so the original bytes are gone. Read it as raw bytes (a Buffer) and decode that.

Which character sets does it know?

The Windows 125x and ISO-8859 families, DOS and Mac code pages, KOI8, the UTF-16 and UTF-32 variants, and Asian sets such as Shift_JIS, EUC-JP, GBK, GB18030 and Big5.

Does it add a byte order mark when saving?

No, not unless you ask for it with the addBOM option; when reading, it removes one by default.

Is it maintained?

Yes. 0.7.3 came out on 3 July 2026 and version 1.0 is in beta.