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/LICENSE3. Used by agents' projects
Dependency in 10 public GitHub projects set up for AI coding agents that we scanned (0.2%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
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
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
Often used with
More about iconv-lite
Funding
- Open Collective: https://opencollective.com/express
Alternatives
iconv-lite This page
Pick jschardet when you first need to guess which character set a file uses; iconv-lite then converts it.
Pick charset-normalizer when your code is in Python and you want the set detected and the text decoded in one step.
Pick ftfy when the text was already decoded wrongly into broken symbols and you need to repair it in Python.
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.”
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.3Decode 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');
Mistakes to avoid
Reading as UTF-8 first already destroys the bytes; decode needs the raw Buffer.
The main-branch README already describes 1.0, where require is no longer a supported entry point.
Missing characters become ? (our run turned 'Hello 世界' in latin1 into 'Hello ??').
No BOM is written unless you ask for it.
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.