首页Home › 编码与加密Encoding & Crypto
🔗 文本转 Data URI(data: 链接生成与解析)Convert ASCII to Data URI
把文本内容转换成 Data URI(data: 链接),可直接嵌入 HTML、CSS 或 Markdown:可选 MIME 类型(纯文本、HTML、CSS、JavaScript、JSON、SVG、CSV 或自定义),Base64 或 URL 百分号编码(SVG 用百分号编码通常更短),可附加 charset=utf-8;也能把 Data URI 解析回原文并显示类型和编码。支持中文等 Unicode 文本,数据在本地处理。Turn text into a Data URI (a data: link) that you can embed straight into HTML, CSS or Markdown. Choose the MIME type (plain text, HTML, CSS, JavaScript, JSON, SVG, CSV or your own), Base64 or URL percent-encoding (percent-encoding is often shorter for SVG), and optionally add charset=utf-8. It also decodes a Data URI back into its text and shows the type and encoding. Chinese and other Unicode text works. Processed locally.
使用说明与常见问题How-to & FAQ
「文本转 Data URI(data: 链接生成与解析)」是什么?What is the Convert ASCII to Data URI tool?
把文本内容转换成 Data URI(data: 链接),可直接嵌入 HTML、CSS 或 Markdown:可选 MIME 类型(纯文本、HTML、CSS、JavaScript、JSON、SVG、CSV 或自定义),Base64 或 URL 百分号编码(SVG 用百分号编码通常更短),可附加 charset=utf-8;也能把 Data URI 解析回原文并显示类型和编码。支持中文等 Unicode 文本,数据在本地处理。Turn text into a Data URI (a data: link) that you can embed straight into HTML, CSS or Markdown. Choose the MIME type (plain text, HTML, CSS, JavaScript, JSON, SVG, CSV or your own), Base64 or URL percent-encoding (percent-encoding is often shorter for SVG), and optionally add charset=utf-8. It also decodes a Data URI back into its text and shows the type and encoding. Chinese and other Unicode text works. Processed locally.
如何使用「文本转 Data URI(data: 链接生成与解析)」?How do I use the Convert ASCII to Data URI tool?
在「文本转 Data URI(data: 链接生成与解析)」中,把内容粘贴或输入到上方输入框,按需设置「方向」、「MIME 类型」、「自定义类型」、「编码」,结果会实时显示在下方,点击「复制结果」即可复制。例如输入「Hello, World!」,得到「data:text/plain;charset=utf-8;base64,SGVsbG8sIFdvcmxkIQ==」。In the Convert ASCII to Data URI: Paste or type into the input box, adjust "Direction", "MIME type", "Custom type", "Encoding"; the result appears below instantly — click "Copy result" to copy it. Example: "Hello, World!" → "data:text/plain;charset=utf-8;base64,SGVsbG8sIFdvcmxkIQ==".
Data URI 是什么?What is a Data URI?
Data URI 把文件内容直接写进链接里,格式为 data:[类型][;charset=utf-8][;base64],数据。浏览器会把它当作一个独立的文件,所以可以在 HTML 的 href / src、CSS 的 url() 里直接使用,不需要单独的文件或网络请求,适合嵌入小图标、样式片段和下载链接。A Data URI puts a file's contents straight into the link, in the form data:[type][;charset=utf-8][;base64],data. Browsers treat it as a file of its own, so it works directly in HTML href / src and CSS url() with no separate file or network request — handy for embedding small icons, style snippets and download links.
Base64 和百分号编码选哪个?Base64 or percent-encoding?
Base64 适合任何内容,长度约为原文的 4/3;百分号编码只转义必要的字符,对 SVG、HTML 这类以 ASCII 为主的文本通常更短也更易读,但中文会变成 %E4%BD%A0 这样的长串。中文文本建议用 Base64 并保留 charset=utf-8,避免乱码。Base64 works for anything and is about 4/3 the original size. Percent-encoding escapes only the characters that need it, so for mostly-ASCII text such as SVG or HTML it's usually shorter and more readable, but Chinese turns into long strings like %E4%BD%A0. For Chinese text, use Base64 and keep charset=utf-8 to avoid garbled characters.
能解析图片的 Data URI 吗?Can it decode image Data URIs?
本工具解析的是文本内容;遇到图片等二进制数据时会提示字节数。要查看或下载图片请使用“Base64 转图片”工具。This tool decodes text content; for images and other binary data it tells you the byte count instead. To view or download an image, use the Base64 to Image tool.
编码和加密有什么区别?Is encoding the same as encryption?
编码(如 Base64、URL 编码)可直接还原,不提供保密性;加密需要密钥。「文本转 Data URI(data: 链接生成与解析)」的处理全部在本地完成。No. Encoding (Base64, URL…) is reversible by anyone; encryption needs a key. The Convert ASCII to Data URI works fully offline in your browser.
「文本转 Data URI(data: 链接生成与解析)」免费吗?需要注册吗?Is the Convert ASCII to Data URI free? Do I need an account?
「文本转 Data URI(data: 链接生成与解析)」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Convert ASCII to Data URI is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.