A responsive, zero-dependency web tool for calculating 3–6 band resistor values and converting ceramic capacitor markings to capacitance—or capacitance values back to standard markings.
Component Code Calculator combines two electronics reference tools in one static webpage:
- Resistor color code calculator: supports 3, 4, 5, and 6 bands, defaults to the 5-band standard, renders a live resistor preview, and shows resistance, tolerance, practical range, and temperature coefficient when applicable.
- Ceramic capacitor code converter: converts common 3-digit, 4-digit, and
Rdecimal markings such as104,1001,4R7, and tolerance-suffixed codes such as104K. Reverse lookup converts a capacitance value into a suitable marking and can append a tolerance code. - Readable unit conversion: capacitor results show the selected or most useful unit together with the neighboring units, including pF, nF, µF, mF, and F.
- Built-in reference: includes resistor calculation guidance, color-to-number mappings, and multiplier references.
- Responsive interface: designed for desktop and mobile screens, with no external fonts, libraries, APIs, tracking, or network requests.
A modern web browser with JavaScript enabled. No installation, package manager, build process, account, or network connection is required.
- Download or clone the repository.
- Open
index.htmlin a browser. - Choose Resistor Color Code or Ceramic Capacitor from the tabs at the top.
For resistor calculations, select the band count and each band color. For capacitor conversion, choose a lookup direction and enter either a printed code or a capacitance value.
- Five-band resistor
brown-black-black-red-brown→10 kΩ ±1% - Capacitor code
104→100 nF→0.1 µF - Capacitor code
4R7→4.7 pF - Capacitance
0.1 µF→ code104
The project can be hosted by Cloudflare Pages, GitHub Pages, Netlify, or any static file server. Publish index.html at the site root. For direct ZIP upload, make sure index.html is at the root of the archive rather than inside another folder.
.
├── index.html # Complete application: HTML, CSS, and JavaScript
├── README.md # English and Chinese documentation
├── CONTRIBUTING.md # Contribution guide
├── SECURITY.md # Vulnerability reporting policy
├── CHANGELOG.md # Version history
├── LICENSE # MIT License
└── .github/ # Issue and pull-request templates
The application intentionally keeps all code in index.html. Edit the file and refresh the browser to see changes. There is currently no automated test suite or build step.
Before submitting a change, manually verify at least these cases:
- the default five-band resistor displays
10 kΩ ±1%; 104Kresolves to100 nFwith ±10% tolerance;4R7resolves to4.7 pF;- reverse lookup converts
0.1 µFto104; - the controls remain usable at narrow mobile widths.
See CONTRIBUTING.md for contribution details and SECURITY.md for security reporting. Version history is available in CHANGELOG.md.
Licensed under the MIT License. Copyright (c) 2026 Minhao Chang.
Component Code Calculator 将两个常用电子元件查询工具集成在一个静态网页中:
- **色环电阻计算器:**支持 3、4、5、6 色环,默认使用 5 色环标准;实时显示电阻外观,并给出阻值、误差、实际范围,以及适用时的温度系数。
- **瓷片电容代号转换器:**支持
104、1001、4R7等常见 3 位、4 位和 R 小数代号,也能识别104K一类带误差字母的代号。反向查询可将实际电容量转换为适当的数字代号,并可附加误差标记。 - **直观单位换算:**电容结果会同时显示当前或最合适单位及其相邻单位,覆盖 pF、nF、µF、mF 和 F。
- **内置计算说明:**包含色环手动计算步骤、颜色数字对照和倍率速查表。
- **响应式界面:**适配电脑和手机,不使用外部字体、程序库、API、统计服务或网络请求。
只需要启用 JavaScript 的现代浏览器。无需安装软件、依赖、构建工具、账户或网络连接。
- 下载或克隆仓库。
- 用浏览器打开
index.html。 - 通过网页顶部标签页选择“色环电阻”或“瓷片电容”。
计算电阻时,选择色环数量及各色环颜色。转换电容时,先选择查询方向,再输入印刷代号或实际电容量。
- 五色环电阻“棕—黑—黑—红—棕” →
10 kΩ ±1% - 电容代号
104→100 nF→0.1 µF - 电容代号
4R7→4.7 pF - 电容量
0.1 µF→ 代号104
本项目可以部署到 Cloudflare Pages、GitHub Pages、Netlify 或任意静态文件服务器。将 index.html 发布在网站根目录即可。使用 ZIP 直接上传时,请确保 index.html 位于压缩包根目录,而不是嵌套在其他文件夹中。
.
├── index.html # 完整应用,包含 HTML、CSS 和 JavaScript
├── README.md # 中英文说明文档
├── CONTRIBUTING.md # 贡献指南
├── SECURITY.md # 安全问题报告方式
├── CHANGELOG.md # 版本更新记录
├── LICENSE # MIT 许可证
└── .github/ # Issue 与 Pull Request 模板
项目有意将全部代码保留在 index.html 中。编辑文件后刷新浏览器即可查看结果。目前没有自动化测试或构建步骤。
提交修改前,请至少手动检查以下情况:
- 默认五色环电阻显示
10 kΩ ±1%; 104K转换为100 nF,误差为 ±10%;4R7转换为4.7 pF;- 反向查询能将
0.1 µF转换为104; - 在较窄的手机屏幕中仍能正常操作所有控件。
贡献说明请参阅 CONTRIBUTING.md,安全问题报告方式请参阅 SECURITY.md。 版本记录请参阅 CHANGELOG.md。
本项目采用 MIT License。Copyright (c) 2026 Minhao Chang。