One-dimensional barcodes can be generated in batches with one piece of content per line, supporting CODE128, CODE39, EAN-13, EAN-8, UPC-A, ITF-14, MSI, Pharmacode, Codabar, adjustable width, height and color, and exported to SVG.
100% Browser local processing0 Data upload
▮ Barcode settings
Number of generated itemssuccessformat mismatchencoding formatserial numbercontentStatusBarcode previewDownload this barcode SVGContent requirements for this formatCan contain numbers, letters, and common symbols, and can be of variable length.Only numbers, uppercase letters, and a few symbols are supported. Please avoid lowercase letters.It requires 12 or 13 digits. If it is 13 digits, the last digit is the check digit. Please confirm it is correct.Requires 7 or 8 digits, the last digit is the check digit when 8 digits are used.Requires 11 or 12 digits. If 12 digits are used, the last digit is the check digit.Requires 13 or 14 digits, often used in logistics outer boxes.Only supports numbers, often used for warehousing and shelf coding.Only numbers are supported and must fall within the allowed range of the standard.Supports numbers and a small number of symbols, with fixed requirements for the first and last characters.DescriptionThe barcode is generated in the browser, and the content is not uploaded or saved; it needs to be regenerated after refreshing the page.There should be blank space on the left and right sides of the barcode, and no text should be cut off or stamped when typesetting and printing.Please enter the content of the barcode to be generated first, one per line.Width, height and font size need to be values greater than zero.The barcode library failed to load, please refresh the page and try again.
After entering the content, click "Generate Barcode"Barcode generation completedIncorrect input, please check settingsThe result is empty, execute the generation firstCopied to clipboardDownload has startedPlease enter the content of the barcode you want to generate first
Barcode preview (click "Download this barcode" to save the SVG separately)
💡 Instructions for use
The encoding format must match the usage scenario: CODE128 is used for internal numbers, storage locations, and asset tags; EAN-13 or UPC-A must be used for retail products, because the cashier system only recognizes these two codes.
EAN-13, EAN-8, UPC-A, ITF-14, etc. have requirements on the number of digits and characters. If the last check digit is incorrect, it cannot be generated. Please use the system rules to calculate the correct encoding first.
The width of the module determines the length of the entire barcode: the longer the content, the greater the horizontal space required. If it cannot fit, the content should be streamlined instead of reducing the width to less than one pixel.
The height only affects the error margin during scanning. If it is too low, it will be difficult to align the handheld device. It is recommended that the height be no less than 50 pixels before printing.
Each result can be exported as an SVG vector file independently, and it will not be blurred when enlarged and printed; the blank areas on the left and right sides should be retained during typesetting.
The barcode is generated in the browser, and the input content is not uploaded or saved; in batch scenarios, it is recommended to generate and download in batches according to label batches.
🧭 How to choose a format so that it will not be rejected by the scanner
The first principle of selecting a format is to look at the usage scenario: there are no restrictions on the content of internal numbers, storage locations and asset tags. Use CODE128 directly, which can carry almost all common characters; if you want to attach it to retail products, you must use EAN-13 or UPC-A, because the cash register system of supermarkets only recognizes these two codes, and the last digit is a check digit calculated by rules. If the number of digits is incorrect, the rendering will fail directly; if industrial equipment or old systems only support CODE39, make sure the content contains only uppercase letters and numbers.
Retail products must use EAN-13 or UPC-A, and CODE128 is the easiest to use for internal labels.
📏 Why should width and height be adjusted?
Width refers to the number of pixels in the thinnest vertical bar, which determines the total length of the entire barcode: the longer the content, the more horizontal space is required. The height only affects the reading margin and does not affect the encoding content, but being too short will make it difficult to aim the handheld scanner. In practice, the method is to use the default width to generate it first, and after exporting it, check whether it can fit in the label layout; if it cannot fit, give priority to changing the format (such as shortening the content) instead of blindly compressing the width. If the width is less than one pixel, it will be mixed together when printed.
When it cannot fit, reduce the content instead of compressing the width. If the content is too thin, the print will become mushy.
🖨️ Benefits of exporting SVG and printing
Barcodes are vector graphics, and the edges of the lines remain sharp when enlarged to any size; if the exported bitmap is a bitmap, it will be blurry after enlargement, and the scanning success rate will decrease accordingly. Each result of the tool can be exported as an SVG file separately, put into label typesetting software or directly handed over to the printer, and can be scaled losslessly according to the target size. It should be noted that the blank space (quiet area) on the left and right sides of the barcode is part of the encoding. Do not cut it off during typesetting, and do not put text or watermarks on it.
Do not cut off or emboss the blank space on the left and right sides of the barcode, that is part of the encoding.
No. The barcode is generated in the browser, and the input content is not uploaded or saved.
Why do some rows display format mismatches??
EAN-13, UPC-A, ITF-14, etc. have requirements on digits and characters. For example, EAN-13 requires 12 or 13 digits and the check digit is correct.
Can I export pictures??
Currently, each item can be exported as an SVG vector file, which can be enlarged without distortion; if a bitmap is needed, it can be saved in the typesetting software.
How many items can be generated at one time??
Processed by row, the generation is slightly slower when the number is large; it is recommended to generate and download in batches according to tags.
Can the number below the barcode be displayed??
Yes. After turning on "Show text", the content will be printed below the barcode. If the scan fails, you can manually check it.
This site is a mirror site and the function has been disabled
The content of this page comes from Hongmu Notes. The copyright and functions are only authorized to be used on the original site. Please visit the original site for the full experience:
Visit the original website www.4s5.cn
📝 Tool feedback
Does this tool have page clutter issues?
Does this tool function properly?
Verification Code: Please calculate the result
…
The verification code is incorrect or has expired; please re-enter it.
Thanks for your feedback! We will deal with and fix this issue as soon as possible after receiving it.
The verification code failed to load; please click ↻ to retry.Please first enter the CAPTCHA answer.
Appearance settings
color matching
Font size
first prizeThank you for participatingSecond Prizedo it againthird prizemystery giftOptionsAt parties or events, you usually strike up conversations with strangersAfter spending a whole day with many people, you will feel tired and need to be aloneYou like to be the center of conversationYou enjoy deep chatting with a few friends more than lively occasionsWhen you need to think, you are more willing to speak or write it out and discuss it with othersCold calls or last-minute invitations often make you feel stressedDuring breaks you tend to go out and meet friends instead of staying at homeYou believe more in facts you see with your own eyes than in abstract speculationsYou often imagine various possibilities for the futureInstructions or process steps are helpful to youYou are more likely to remember overall impressions than specific detailsYou like to use metaphors and associations to explain somethingYou focus more on what you need to do now rather than the long-term blueprintWhen reading a story, you care more about whether the plot is close to realityWhen making a decision, you will first look at whether the data and logic are validWhen a friend complains, your first reaction is to comfort him rather than give him advice.When a mistake is pointed out, you care more about the objectiveness of the reasons rather than the tone of voice.You will adjust your expression in order to maintain relationship harmonyWhen evaluating a plan, you first pay attention to its feasibility and efficiencyYou are easily affected by other people's emotionsDo you think fairness is more important than favor?Before you go on a trip, you are used to planning your itinerary clearly.A last-minute change of plans can make you feel excited rather than upsetYou are used to making to-do lists and completing them one by oneYour desktop or files are often placed casually but you can find them by yourselfYou feel uncomfortable when things are unresolved and tend to make decisions as quickly as possibleYou like to keep your options open and decide laterYou'll meet deadlines well in advance rather than rushing at the last minuteStrongly disagreeDisagreeNot sureAgreeStrongly agreeIndependent strategist: good at long-term planning, emphasizing logic and efficiency, and likes to put ideas into systems.Logic Explorer: Strong curiosity, likes to dismantle principles, and hates being bound by processes.Goal-driven commander: Good at coordinating resources and pushing the team to achieve results.Witty debater: has many ideas, quick reactions, and likes to challenge established conclusions.Advocates who understand people's hearts: value meaning and value, and be sensitive to the emotions of others.Idealists: Have clear values in their hearts and pursue truth and creation.Contagious leader: good at encouraging others and willing to promote cooperation.Passionate thinker: has broad interests and is good at connecting people and opportunities.Pragmatic Guardian: Reliable, rule-abiding, emphasizing facts and responsibilities.Meticulous protector: considerate, patient, and willing to silently support those around him.Efficient organizer: strong execution ability and habit of arranging things in an orderly manner.Enthusiastic Coordinator: Values interpersonal harmony and is willing to take care of the needs of the group.A calm doer: strong in practical skills, calm in situations, and good at troubleshooting.Gentle artist: Feels delicately and likes to express through actions rather than words.Flexible activist: quick to respond and willing to solve problems in actual combat.A dynamic performer who enjoys the moment and is good at heating up the place.If you suddenly have a whole day free on the weekend, you willInvite friends to go out for a walkCatching up on sleep and watching dramas at homeDepends on your mood, make a temporary decisionWhen joining a new group chat, you usuallySend an emoji first to enliven the atmosphereSilently watching everyone chattingDive first, and then chime in when you encounter a topic of interest.A friend asks you to do a difficult favor. What will you do?Commit first and then think of a solutionFirst assess whether you can do itExplain the difficulties directly and discuss them togetherBoth options have their own pros and cons, which one do you prefer?List the score sheet for item-by-item comparisonChoose the one that is more pleasing to your eyes based on your intuition.Try it on a small scale first before decidingWhen faced with a new task, your first step is toGet started right away and adjust as you goFind information first to get the full pictureTalk to people who have done it and talk about their experiencesWhen your plans are temporarily disrupted, youAdjust quickly and even get a little excitedIt's a bit annoying, but I'll do it againLet’s figure out the new goals first.Before making important decisions, you believe morePast data and experienceown feelingsAdvice from people around youIn the team you play more oftenperson who drives progressA person who sorts out logicThe person who harmonizes the atmosphereWhen learning new skills, you preferStart working on the project directlyRead the system tutorial firstFind an example and follow itWhen others criticize your work, you willFirst ask what exactly is wrongIt's a bit uncomfortable, but I'll remember itSay it's okay with your mouth, think about it laterThe ideal working condition isFast pace and lots of changesStable and predictableFree and able to make arrangements by oneselfyou would rather spend your timemeet different peopleDo one thing to the extremeTry new thingsCharge Captain: Sociable and decisive, able to quickly determine direction in chaos.Robust commander: He is good at leading people and also pays attention to steps. He is the anchor of the team.Passionate initiator: Driven by passion, he can often bring everyone together with just one sentence.Heart-warming executor: Cares about everyone's feelings and is willing to do the details well.Calm planner: Does not talk much, but has clear logic and quick judgment.In-depth researcher: Likes to study alone and pays attention to methods and causes and consequences.Intuitive Creator: Feels strongly inside and acts quickly when inspiration comes.Still water deep flow type: sensitive, patient, good at polishing one thing for a long time.S gregariousL aloneH mindF heartQ fast paceM slow pace(living in groups% 、 头脑% 、 快节奏Custom colorDrag the image here, or click to upload<p>Supports common image formats such as JPG, PNG, WebP, GIF, and BMP<br>You can also directly<kbd>Ctrl</kbd>+<kbd>V</kbd>Paste picture<br> Once processing is complete, you can download the items one by one, or package them into a ZIP file for one-click download.</p>➕ Continue to add⬇ Download all✕ Clear the listNo files yet, please upload pictures<p>共 <strong>{n}</strong>files</p>Processing…Processing completedImage loading failedPlease upload image fileList clearedRemovedDownloadPreviewCloseProcessing result previewDownload has startedNo files available for downloadAre you sure you want to clear all files?It is recommended not to exceed {max} images at a time📦 Package download ZIP: ''' }[c];
});
}
function stripExt(name) {
return String(name).replace(/\.[^.]+$/, '');
}
function resolveEl(ref) {
if (!ref) return null;
return typeof ref === 'string' ? document.getElementById(ref) : ref;
}
function format(str, data) {
if (!data) return str;
Object.keys(data).forEach(function (k) {
str = str.split('{' + k + '}').join(data[k]);
});
return str;
}
function readI18n(sel) {
var out = {};
var box = document.querySelector(sel || '#ie-i18n');
if (!box) return out;
box.querySelectorAll('[data-key]').forEach(function (el) {
out[el.getAttribute('data-key')] = el.textContent.trim();
});
return out;
}
function loadImage(file) {
return new Promise(function (resolve, reject) {
var reader = new FileReader();
reader.onload = function (e) {
var img = new Image();
img.onload = function () { resolve(img); };
img.onerror = function () { reject(new Error('image decode failed')); };
img.src = e.target.result;
};
reader.onerror = function () { reject(new Error('file read failed')); };
reader.readAsDataURL(file);
});
}
function canvasToBlob(canvas, type, quality) {
return new Promise(function (resolve, reject) {
canvas.toBlob(function (blob) {
if (blob) resolve(blob);
else reject(new Error('canvas export failed'));
}, type, quality);
});
}
function makeCanvas(w, h) {
var c = document.createElement('canvas');
c.width = Math.max(1, Math.round(w));
c.height = Math.max(1, Math.round(h));
return c;
}
function ctxOf(canvas) {
return canvas.getContext('2d');
}
function fitSize(w, h, maxW, maxH) {
if (!maxW && !maxH) return { w: w, h: h };
var scale = Math.min(maxW ? maxW / w : Infinity, maxH ? maxH / h : Infinity, Infinity);
if (scale >= 1) return { w: w, h: h }; // 不放大
return { w: Math.max(1, Math.round(w * scale)), h: Math.max(1, Math.round(h * scale)) };
}
function thumbnail(img, maxSide, bg) {
var s = fitSize(img.naturalWidth, img.naturalHeight, maxSide, maxSide);
var c = makeCanvas(s.w, s.h);
var ctx = ctxOf(c);
if (bg) { ctx.fillStyle = bg; ctx.fillRect(0, 0, s.w, s.h); }
ctx.drawImage(img, 0, 0, s.w, s.h);
return c.toDataURL('image/jpeg', 0.9);
}
function buildUI(root, opts, labels) {
var uid = 'ie' + Math.random().toString(36).slice(2, 7);
var ids = {
drop: uid + '-drop',
input: uid + '-input',
panel: uid + '-panel',
preview: uid + '-preview',
toolbar: uid + '-toolbar',
addMore: uid + '-add-more',
downAll: uid + '-download-all',
clear: uid + '-clear',
count: uid + '-count',
list: uid + '-list',
empty: uid + '-empty'
};
var html =
'
[ImgEdit] readOptions error[ImgEdit] processing failed:[ImgEdit] Loading failed:[ImgEdit] editor.setup errorPacking, please waitPacking {done}/{total}Packaging completed, download has startedPackaging failed, please try againCopiedCopy failedIllegal characters:Expression is incompleteUnknown symbol:extra right bracketillegal expressionExpression has redundant contentThis site is a mirror site and the function has been disabledThe content of this page comes from Hongmu Notes. The copyright and functions are only authorized to be used on the original site.Visit original siteLocate that line and delete itSubmission failed, please try again later(Current data totalcolumn):''' }[c];
});
}
// ============ 主题切换(与博客首页同一套:data-theme + tui-theme)============
function isDark() {
var el = document.documentElement;
return el.getAttribute('data-theme') === 'dark' || el.classList.contains('dark-mode');
}
function setTheme(dark) {
var el = document.documentElement;
el.setAttribute('data-theme', dark ? 'dark' : 'light');
el.classList.toggle('dark-mode', dark); // 兼容部分工具内部旧的 .dark-mode 规则
try {
localStorage.setItem('tui-theme', dark ? 'dark' : 'light');
localStorage.setItem('a6_dark_mode', dark ? '1' : '0');
} catch (e) {}
}
function initTheme() {
var btn = document.getElementById('tuiThemeBtn') || document.getElementById('t-theme');
if (!btn) return;
function sync() { btn.classList.toggle('is-dark', isDark()); }
sync();
btn.addEventListener('click', function () {
setTheme(!isDark());
sync();
});
}
// ============ 返回顶部 ============
function initTop() {
var btn = document.getElementById('tuiTopBtn');
if (!btn) return;
function onScroll() {
btn.style.display = (window.pageYOffset > 300) ? '' : 'none';
}
window.addEventListener('scroll', onScroll, { passive: true });
onScroll();
btn.addEventListener('click', function () {
window.scrollTo({ top: 0, behavior: 'smooth' });
});
}
// ============ 工具目录:精确悬浮在内容卡片右侧 ============
// 用 JS 读取主体卡片的真实右边界来定位(不依赖 CSS 计算),
// 右侧空间不足时自动回退为顶部横滑胶囊(移除 inline 定位即可)。
function initTocFloat() {
var aside = document.querySelector('.t-toc-aside');
var main = document.querySelector('.t-layout .t-main');
if (!aside || !main) return;
var GAP = 14; // 目录与卡片间距
var W = 224; // 目录宽度(与 CSS 的 .t-toc-aside 宽度保持一致)
function reset() {
aside.style.position = '';
aside.style.left = '';
aside.style.right = '';
aside.style.top = '';
aside.style.width = '';
aside.style.maxHeight = '';
aside.style.overflowY = '';
aside.classList.remove('is-floating');
}
function layout() {
reset();
if (window.innerWidth < 1024) return; // 窄屏:胶囊布局
var box = main.getBoundingClientRect();
var left = Math.round(box.left - GAP - W); // 目录放在卡片左侧(与内容页目录一致)
if (left < 8) return; // 左侧放不下:胶囊布局
aside.style.position = 'fixed';
aside.style.left = left + 'px';
aside.style.top = '84px';
aside.style.width = W + 'px';
aside.style.maxHeight = 'calc(100vh - 110px)';
aside.style.overflowY = 'auto';
aside.style.zIndex = '5';
aside.classList.add('is-floating');
}
layout();
window.addEventListener('resize', layout, { passive: true });
window.addEventListener('load', layout);
window.setTimeout(layout, 300); // 字体/图片加载后校正一次
}
// ============ 外观设置(配色 + 字号,记忆在 localStorage) ============
function initAppearance() {
var btn = document.getElementById('tAppearanceBtn');
var panel = document.getElementById('tAppearance');
if (!btn || !panel) return;
function read(k) { try { return localStorage.getItem(k) || ''; } catch (e) { return ''; } }
function write(k, v) { try { localStorage.setItem(k, v); } catch (e) {} }
function apply(accent, fs) {
var el = document.documentElement;
if (accent && accent !== 'default') { el.setAttribute('data-accent', accent); }
else { el.removeAttribute('data-accent'); }
if (fs && fs !== 'm') { el.setAttribute('data-fs', fs); }
else { el.removeAttribute('data-fs'); }
var i, list = panel.querySelectorAll('[data-accent]');
for (i = 0; i < list.length; i++) {
list[i].classList.toggle('is-on', list[i].getAttribute('data-accent') === (accent || 'default'));
}
list = panel.querySelectorAll('[data-fs]');
for (i = 0; i < list.length; i++) {
list[i].classList.toggle('is-on', list[i].getAttribute('data-fs') === (fs || 'm'));
}
}
var cur = { accent: read('t-accent') || 'default', fs: read('t-fs') || 'm' };
apply(cur.accent, cur.fs);
btn.addEventListener('click', function (e) {
e.stopPropagation();
panel.hidden = !panel.hidden;
});
var close = document.getElementById('tAppearanceClose');
if (close) close.addEventListener('click', function () { panel.hidden = true; });
panel.addEventListener('click', function (e) {
var t = e.target;
if (!t || !t.getAttribute) return;
var ac = t.getAttribute('data-accent');
var fs = t.getAttribute('data-fs');
if (ac) { cur.accent = ac; write('t-accent', ac); apply(cur.accent, cur.fs); }
if (fs) { cur.fs = fs; write('t-fs', fs); apply(cur.accent, cur.fs); }
});
document.addEventListener('click', function (e) {
if (panel.hidden) return;
if (panel.contains(e.target) || e.target === btn) return;
panel.hidden = true;
});
}
// 页面底部脚本加载,DOM 已就绪,直接初始化
initTheme();
initTop();
initTocFloat();
initAppearance();
// ============ 对外暴露 ============
window.Tools = {
isLocal: isLocalFile || isWrongHost,
audio: getAudio,
toast: toast,
copy: copy,
note: note,
chord: chord,
midiName: midiName,
midiFreq: midiFreq,
NOTE_NAMES: NOTE_NAMES,
esc: esc,
theme: initTheme,
};
// ============ 本地/非法域名提示 ============
if (window.Tools.isLocal) {
document.addEventListener('DOMContentLoaded', function () {
var tip = document.createElement('div');
tip.style.cssText = 'position:fixed;left:50%;top:20px;transform:translateX(-50%);'
+ 'background:#e74c3c;color:#fff;padding:10px 20px;border-radius:8px;'
+ 'font-size:.9rem;z-index:99999;';
tip.textContent = '请从 4s5.cn 访问本工具';
document.body.appendChild(tip);
setTimeout(function () { tip.style.opacity = '0'; tip.style.transition = 'opacity .5s'; }, 3000);
setTimeout(function () { tip.parentNode && tip.parentNode.removeChild(tip); }, 3600);
});
}
})();
(function (window, document) {
'use strict';
var SEL = 'ins.adsbygoogle, ins.adsbygoogle iframe, iframe[id^=