{
 "kind": "tool",
 "slug": "iconv-lite",
 "path": "tools/iconv-lite/",
 "name": "iconv-lite",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Utilities",
   "tools/utilities/"
  ]
 ],
 "lead": "Read and write text in older encodings.",
 "chips": [
  {
   "label": "Utilities",
   "path": "tools/utilities/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install iconv-lite"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/pillarjs/iconv-lite"
  },
  {
   "label": "Website",
   "href": "https://github.com/pillarjs/iconv-lite"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "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",
   "note": "MIT allows use in paid and closed-source products.",
   "src": "https://github.com/pillarjs/iconv-lite/blob/v0.7.3/LICENSE"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 23, 2026",
   "note": "Latest GitHub release Jul 3, 2026. ",
   "src": "https://github.com/pillarjs/iconv-lite"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "10 projects",
   "status": "info",
   "sub": "#120 of 408 in its category",
   "note": "Dependency in 10 public GitHub projects set up for AI coding agents that we scanned (0.2%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 10, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What iconv-lite does",
   "parts": [
    {
     "t": "prose",
     "text": "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."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Open files from older programs",
       "text": "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.",
       "idea": false
      },
      {
       "title": "Send files to an older system",
       "text": "A bank, shop till or warehouse system only accepts files in its own character set; your app writes the export in exactly that set.",
       "idea": false
      },
      {
       "title": "Accept form posts in other encodings",
       "text": "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.",
       "idea": false
      },
      {
       "title": "Convert large files piece by piece",
       "text": "A nightly job turns big old exports into UTF-8 without loading the whole file into memory at once.",
       "idea": false
      },
      {
       "title": "Scrape pages in older encodings",
       "text": "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.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "iconv-lite popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "62",
       "of": "/ 100",
       "l": "Gid Score, #891 overall"
      },
      {
       "n": "449M",
       "l": "downloads a week, npm"
      },
      {
       "n": "3,186",
       "l": "GitHub stars"
      },
      {
       "n": "10",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How iconv-lite is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "7 projects, 0.2%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "5 projects, 0.2%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "5 projects, 1.5%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 77.4% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 67.7% of its projects",
       "v": "Vitest",
       "path": "tools/vitest/"
      },
      {
       "l": "In 64.5% of its projects",
       "v": "Vite",
       "path": "tools/vite/"
      },
      {
       "l": "In 54.8% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 54.8% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 45.2% of its projects",
       "v": "jsdom",
       "path": "tools/jsdom/"
      },
      {
       "l": "In 41.9% of its projects",
       "v": "Model Context Protocol SDK (JavaScript)",
       "path": "tools/modelcontextprotocol/"
      },
      {
       "l": "In 38.7% of its projects",
       "v": "Anthropic SDK",
       "path": "tools/anthropic-ai/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about iconv-lite",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "Open Collective: https://opencollective.com/express"
       ]
      },
      {
       "title": "More in Utilities",
       "path": "tools/utilities/",
       "items": [
        {
         "text": "clsx",
         "path": "tools/clsx/"
        },
        {
         "text": "date-fns",
         "path": "tools/date-fns/"
        },
        {
         "text": "PyYAML",
         "path": "tools/pyyaml/"
        },
        {
         "text": "uuid",
         "path": "tools/uuid/"
        },
        {
         "text": "yaml",
         "path": "tools/yaml/"
        },
        {
         "text": "js-yaml",
         "path": "tools/js-yaml/"
        },
        {
         "text": "glob",
         "path": "tools/glob/"
        },
        {
         "text": "Lodash",
         "path": "tools/lodash/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "iconv-lite",
       "me": true,
       "facts": [
        "MIT",
        "Gid 62",
        "449M/wk"
       ]
      },
      {
       "name": "jschardet",
       "why": "Pick jschardet when you first need to guess which character set a file uses; iconv-lite then converts it.",
       "path": "tools/jschardet/",
       "facts": []
      },
      {
       "name": "charset-normalizer",
       "why": "Pick charset-normalizer when your code is in Python and you want the set detected and the text decoded in one step.",
       "path": "tools/charset-normalizer/",
       "facts": []
      },
      {
       "name": "ftfy",
       "why": "Pick ftfy when the text was already decoded wrongly into broken symbols and you need to repair it in Python.",
       "path": "tools/ftfy/",
       "facts": []
      }
     ],
     "more": "Compare iconv-lite with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "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."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Add the stable version (0.7.x) to your project; it works with require in any Node.js version.",
       "code": "npm install iconv-lite@0.7.3",
       "src": "https://registry.npmjs.org/iconv-lite"
      },
      {
       "text": "Decode bytes into text, or encode text into bytes, naming the character set.",
       "code": "var iconv = require('iconv-lite');\n\n// Convert from an encoded buffer to a js string.\nstr = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');\n\n// Convert from a js string to an encoded buffer.\nbuf = iconv.encode(\"Sample input string\", 'win1251');\n",
       "src": "https://github.com/pillarjs/iconv-lite/blob/v0.7.3/README.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "fs.readFileSync('old.csv', 'utf8') and then iconv.decode(text, 'windows-1252')",
       "fix": "fs.readFileSync('old.csv') (no encoding, so you get a Buffer) and then iconv.decode(bytes, 'windows-1252')",
       "why": "Reading as UTF-8 first already destroys the bytes; decode needs the raw Buffer."
      },
      {
       "dont": "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')",
       "fix": "Stay on iconv-lite@0.7.3 with require, or move to 1.0 together with ES module imports and Node.js 22+",
       "why": "The main-branch README already describes 1.0, where require is no longer a supported entry point."
      },
      {
       "dont": "Expecting iconv.encode('Café 世界', 'ascii') to give 'Cafe ...' style replacements",
       "fix": "Pick a target set that has the characters, or replace them yourself before encoding",
       "why": "Missing characters become ? (our run turned 'Hello 世界' in latin1 into 'Hello ??')."
      },
      {
       "dont": "Expecting iconv.encode(text, 'utf8') output to start with a byte order mark",
       "fix": "Pass { addBOM: true } when the receiving program needs one",
       "why": "No BOM is written unless you ask for it."
      },
      {
       "dont": "Calling iconv.decodeStream in React Native without a stream module",
       "fix": "Install a stream module first, as the README says, or use the one-shot decode",
       "why": "The streaming API needs the stream module, which React Native does not ship."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Can I use it in a paid, closed-source app?",
       "a": "Yes. It is MIT licensed; keep the copyright and license notice with the package.",
       "evidence": {
        "url": "https://github.com/pillarjs/iconv-lite/blob/v0.7.3/LICENSE",
        "quote": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software."
       }
      },
      {
       "q": "Why do I still get broken symbols after decoding?",
       "a": "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.",
       "evidence": {
        "url": "https://github.com/pillarjs/iconv-lite/blob/v0.7.3/README.md",
        "quote": "When decoding, be sure to supply a Buffer to decode() method, otherwise bad things usually happen."
       }
      },
      {
       "q": "Which character sets does it know?",
       "a": "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.",
       "evidence": {
        "url": "https://github.com/pillarjs/iconv-lite/blob/v0.7.3/README.md",
        "quote": "All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library."
       }
      },
      {
       "q": "Does it add a byte order mark when saving?",
       "a": "No, not unless you ask for it with the addBOM option; when reading, it removes one by default.",
       "evidence": {
        "url": "https://github.com/pillarjs/iconv-lite/blob/v0.7.3/README.md",
        "quote": "Encoding: No BOM added, unless overridden by addBOM: true option."
       }
      },
      {
       "q": "Is it maintained?",
       "a": "Yes. 0.7.3 came out on 3 July 2026 and version 1.0 is in beta.",
       "evidence": {
        "url": "https://registry.npmjs.org/iconv-lite",
        "quote": "\"0.7.3\":\"2026-07-03T17:53:11.119Z\""
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm iconv-lite"
  ],
  [
   "Category",
   "Utilities"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Gid Score",
   "61.8"
  ],
  [
   "Rank in category",
   "#120 of 408"
  ],
  [
   "GitHub",
   "pillarjs/iconv-lite"
  ],
  [
   "Last change",
   "Nov 23, 2026"
  ]
 ],
 "good": [
  "It does not guess the character set. Your code has to know it, for example from the file's source or a page header.",
  "Characters the target set lacks become question marks or a replacement sign; it does not swap them for similar letters.",
  "In the browser it needs a build tool and a shim for Node.js's binary data type, about 180 kB compressed in total."
 ],
 "checked_line": "Read by AgentGid from 6 official pages, card checked Nov 10, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/pillarjs.png"
}