-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathocr-tool.html
More file actions
272 lines (252 loc) · 29.9 KB
/
Copy pathocr-tool.html
File metadata and controls
272 lines (252 loc) · 29.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-CT8E5N460D"></script>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-CT8E5N460D');</script>
<title>OCR Tool - Free Online Image to Text | No Ads</title>
<meta name="description" content="Free online OCR tool to extract text from images in your browser. Convert image to text for screenshots, documents, and photos. ✅ No ads ✅ No signup ✅ No limits. Runs entirely in your browser.">
<meta name="keywords" content="ocr online, image to text, extract text from image, ocr tool, no ads, no signup, no login, no watermark, free unlimited, browser-based, no installation, local processing">
<meta name="author" content="UseMagicTools">
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">
<meta name="googlebot" content="index, follow">
<meta name="bingbot" content="index, follow">
<meta name="revisit-after" content="7 days">
<meta name="rating" content="general">
<meta name="distribution" content="global">
<meta name="language" content="en">
<link rel="canonical" href="https://www.usemagictools.com/ocr-tool.html">
<link rel="alternate" hreflang="en" href="https://www.usemagictools.com/ocr-tool.html">
<link rel="alternate" hreflang="zh-CN" href="https://www.usemagictools.com/ocr-tool.html">
<link rel="alternate" hreflang="fr" href="https://www.usemagictools.com/ocr-tool.html">
<link rel="alternate" hreflang="es" href="https://www.usemagictools.com/ocr-tool.html">
<link rel="alternate" hreflang="x-default" href="https://www.usemagictools.com/ocr-tool.html">
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.usemagictools.com/ocr-tool.html">
<meta property="og:title" content="OCR Tool - Free Online Image to Text | No Ads">
<meta property="og:description" content="Extract text from screenshots, scanned documents, and photos with OCR online.">
<meta property="og:image" content="https://www.usemagictools.com/screenshots/ocr-tool-v1.webp">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:locale" content="en_US">
<meta property="og:locale:alternate" content="zh_CN">
<meta property="og:site_name" content="Magic Toolbox">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@usemagictools">
<meta name="twitter:creator" content="@usemagictools">
<meta name="twitter:title" content="OCR Tool - Free Online Image to Text | No Ads">
<meta name="twitter:description" content="Convert image to text using browser OCR. No ads, no signup.">
<meta name="twitter:image" content="https://www.usemagictools.com/screenshots/ocr-tool-v1.webp">
<script type="application/ld+json">
{
"@context":"https://schema.org",
"@type":"WebApplication",
"name":"OCR Tool",
"alternateName":["图片文字识别","Image to Text OCR","OCR Online"],
"url":"https://www.usemagictools.com/ocr-tool.html",
"description":"Free online OCR tool for extracting text from images and screenshots in browser.",
"inLanguage":["en","zh-CN","fr","es"],
"applicationCategory":"UtilitiesApplication",
"operatingSystem":"Web Browser",
"offers":{"@type":"Offer","price":"0","priceCurrency":"USD"},
"author":{"@type":"Person","name":"UseMagicTools"},
"publisher":{"@type":"Organization","name":"Web Toolbox","url":"https://www.usemagictools.com/"},
"featureList":["Image to text OCR online","Screenshot text extraction","Multi-language OCR mode","One-click copy result","No ads","No signup required","No watermark","100% browser-based","Unlimited usage"],
"screenshot":"https://www.usemagictools.com/screenshots/ocr-tool-v1.webp"
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://www.usemagictools.com/"
},
{
"@type": "ListItem",
"position": 2,
"name": "OCR Tool",
"item": "https://www.usemagictools.com/ocr-tool.html"
}
]
}
</script>
<script type="application/ld+json">
{
"@context":"https://schema.org",
"@type":"HowTo",
"name":"How to Extract Text from Image with OCR Tool",
"totalTime":"PT1M",
"step":[
{"@type":"HowToStep","position":1,"name":"Upload image","text":"Select a screenshot, scan, or photo that contains text."},
{"@type":"HowToStep","position":2,"name":"Run OCR","text":"Choose OCR language and click Extract Text to process image to text."},
{"@type":"HowToStep","position":3,"name":"Copy result","text":"Review the recognized text and copy it for notes, documents, or search."}
]
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is OCR and what is it used for?",
"acceptedAnswer": {
"@type": "Answer",
"text": "OCR stands for Optical Character Recognition — a technology that converts text within images, screenshots, scanned documents, and photographs into editable, searchable digital text. It is widely used for digitizing printed documents, extracting data from receipts, translating text from photos, and archiving paper records. This free browser-based OCR tool requires no signup and keeps your images private."
}
},
{
"@type": "Question",
"name": "Can this OCR tool extract text from screenshots and scanned PDFs?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes. This free image-to-text converter works excellently with screenshots, scanned document images, and photographs containing text. For scanned PDFs, first convert the PDF pages to image format using our PDF-to-Image tool, then run OCR on each page. The recognition engine handles various fonts and layouts. No signup required, and all processing is browser-based for privacy."
}
},
{
"@type": "Question",
"name": "Which OCR languages are supported?",
"acceptedAnswer": {
"@type": "Answer",
"text": "This tool supports multiple OCR language modes including English, Chinese (Simplified and Traditional), French, Spanish, and other major languages. Selecting the correct language mode improves recognition accuracy significantly, especially for non-Latin scripts. The recognition engine uses trained language models optimized for each language. Completely free with no signup, no ads, and private browser-based processing."
}
},
{
"@type": "Question",
"name": "Is OCR processing private and local?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes. The OCR engine runs entirely in your browser using client-side processing — no server upload is required and no account creation is needed. Your image files and extracted text are never sent to any external server. This makes it safe for processing sensitive documents like contracts, medical records, and financial statements. Completely free with no ads or data collection."
}
},
{
"@type": "Question",
"name": "Is this tool really free with no ads?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes, 100% free with no ads, no registration, no watermark, and no usage limits. All processing happens locally in your browser — your data is never uploaded to any server."
}
}
]
}
</script>
<style>
:root{--bg:#020617;--panel:#0b1220;--card:#0f172a;--muted:#94a3b8;--text:#e2e8f0;--border:rgba(148,163,184,.2);--primary:#3b82f6;--primary2:#2563eb;--radius:12px}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:"Inter","SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:radial-gradient(circle at 20% 0%,rgba(59,130,246,.18),transparent 40%),radial-gradient(circle at 100% 0%,rgba(16,185,129,.12),transparent 38%),var(--bg);color:var(--text);min-height:100vh;padding:24px 16px 60px}
.container{max-width: 1200px;margin:0 auto}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}
h1{text-align:center;font-size:2.1rem;letter-spacing:-.02em;margin-bottom:10px}.subtitle{text-align:center;color:var(--muted);margin-bottom:22px}
.card{background:rgba(15,23,42,.82);border:1px solid var(--border);border-radius:var(--radius)}.tool-card{padding:14px}
.toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px;align-items:center}.btn{border:1px solid var(--border);background:#0b1220;color:var(--text);padding:8px 12px;border-radius:8px;font-size:13px;cursor:pointer}
.btn:hover{border-color:#64748b}.btn.primary{background:linear-gradient(135deg,var(--primary),var(--primary2));border-color:transparent;color:#fff}
.select{padding:8px;border:1px solid rgba(148,163,184,.25);background:#020617;color:#e2e8f0;border-radius:8px}
.layout{display:grid;grid-template-columns:1fr 1fr;gap:12px}.panel{border:1px solid var(--border);border-radius:10px;background:rgba(2,6,23,.58);overflow:hidden}
.panel-head{padding:10px 12px;border-bottom:1px solid var(--border);font-size:13px;color:var(--muted)}
.drop{padding:16px;display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center;min-height:260px;text-align:center;color:var(--muted)}
.drop.drag{background:rgba(59,130,246,.12)}.preview{max-width:100%;max-height:220px;border-radius:8px;display:none}
textarea{width:100%;min-height:260px;border:0;outline:none;padding:14px;background:#020617;color:var(--text);font-size:14px;line-height:1.7;font-family:"JetBrains Mono","SF Mono",Consolas,monospace}
.status{margin-top:8px;color:#93c5fd;font-size:13px;min-height:18px}
.features-section,.faq-section,.features-section h2,.faq-section h2,.features-grid,.feature,.related{border:1px solid var(--border);border-radius:10px;padding:12px;background:rgba(2,6,23,.58)}.feature h4,.related h4{margin:8px 0 6px;font-size:14px}.feature p,.related p{color:var(--muted);font-size:13px;line-height:1.55}
.related{text-decoration:none;color:inherit;display:block}.related:hover{border-color:#64748b}
.faq-item{border:1px solid var(--border);border-radius:10px;margin-bottom:8px;overflow:hidden;background:rgba(2,6,23,.5)}.faq-question{width:100%;text-align:left;background:transparent;border:0;color:var(--text);padding:12px 14px;cursor:pointer;font-size:14px}
.faq-answer{display:none;padding:0 14px 12px;color:var(--muted);font-size:13px;line-height:1.6}.faq-item.active .faq-answer{display:block}
@media (max-width:960px){.layout{grid-template-columns:1fr}}
@media (max-width:640px){h1{font-size:1.7rem}}
</style>
<link rel="stylesheet" href="common/common.css">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="icon" href="/favicon.ico" sizes="48x48">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
</head>
<body>
<div class="container">
<h1 data-i18n="title">OCR Tool</h1>
<p class="subtitle" data-i18n="subtitle">Extract text from image online with browser OCR</p>
<section class="card tool-card">
<div class="toolbar">
<input id="fileInput" type="file" accept="image/*" style="display:none">
<button class="btn" id="chooseBtn" data-i18n="choose">Choose Image</button>
<select id="langSel" class="select"><option value="eng">English</option><option value="chi_sim">中文</option><option value="fra">Français</option><option value="spa">Español</option></select>
<button class="btn primary" id="extractBtn" data-i18n="extract">Extract Text</button>
<button class="btn" id="copyBtn" data-i18n="copy">Copy Text</button>
<button class="btn" id="clearBtn" data-i18n="clear">Clear</button>
</div>
<div class="layout">
<div class="panel"><div class="panel-head" data-i18n="inputPanel">Image Input</div><div class="drop" id="dropZone"><p data-i18n="dropHint">Drag and drop image here or click Choose Image</p><img id="preview" class="preview" alt="preview"><small id="fileName"></small></div></div>
<div class="panel"><div class="panel-head" data-i18n="outputPanel">OCR Result</div><textarea id="resultText" data-i18n-placeholder="resultPlaceholder" placeholder="Recognized text appears here..."></textarea></div>
</div>
<div class="status" id="status"></div>
</section>
<div class="trust-bar"><span class="trust-item" data-i18n="trust_users">🌍 Used by 50,000+ users</span><span class="trust-item" data-i18n="trust_rating">⭐ 4.9/5 rating</span><span class="trust-item" data-i18n="trust_privacy">🔒 100% Private</span><span class="trust-item" data-i18n="trust_free">🚫 No Ads, No Signup</span></div>
<section class="features-section"><h2 data-i18n="features_title">OCR Tool Features</h2><div class="features-grid"><article class="feature"><div>🔒</div><h4 data-i18n="f1_t">100% Free & Private</h4><p data-i18n="f1_d">No ads, no signup, no watermark. Everything runs locally in your browser. Your data never leaves your device.</p></article><article class="feature"><div>🧠</div><h4 data-i18n="f2_t">Image to Text OCR</h4><p data-i18n="f2_d">Convert screenshots, scans, and photos into editable text with OCR online.</p></article><article class="feature"><div>🌐</div><h4 data-i18n="f3_t">Multi-language Recognition</h4><p data-i18n="f3_d">Choose OCR language mode for English, Chinese, French, and Spanish text extraction.</p></article><article class="feature"><div>📋</div><h4 data-i18n="f4_t">One-click Copy</h4><p data-i18n="f4_d">Copy recognized text instantly for translation, search, notes, and document reuse.</p></article></div></section>
<section class="faq-section"><h2 data-i18n="faq_title">Frequently Asked Questions</h2>
<div class="faq-item"><button class="faq-question" data-i18n="faq1_q">What is OCR and what is it used for?</button><div class="faq-answer" data-i18n="faq1_a">OCR means Optical Character Recognition. It converts text in screenshots, scans, and photos into editable text for search, translation, and documentation workflows.</div></div>
<div class="faq-item"><button class="faq-question" data-i18n="faq2_q">Can this OCR tool extract text from screenshots and scanned PDFs?</button><div class="faq-answer" data-i18n="faq2_a">Yes. This image to text converter works well for screenshots and scanned document images. For PDFs, convert pages to images first, then run OCR online.</div></div>
<div class="faq-item"><button class="faq-question" data-i18n="faq3_q">Which OCR languages are supported?</button><div class="faq-answer" data-i18n="faq3_a">The tool provides common OCR language modes like English, Chinese, French, and Spanish. Pick the closest language to improve text recognition accuracy.</div></div>
<div class="faq-item"><button class="faq-question" data-i18n="faq4_q">Is OCR processing private and local?</button><div class="faq-answer" data-i18n="faq4_a">Yes. OCR runs in your browser with local processing logic and no account requirement. Image files are not uploaded by this page to any app server.</div></div>
<div class="faq-item"><button class="faq-question" data-i18n="faq_free_q">Is this tool really free with no ads?</button><div class="faq-answer" data-i18n="faq_free_a">Yes, 100% free with no ads, no registration, no watermark, and no usage limits. All processing happens locally in your browser — your data is never uploaded to any server.</div></div>
</section>
<section class="related-tools"><h3 data-i18n="relatedToolsTitle">Related Tools</h3><div class="related-grid"><a class="related" href="image-editor.html"><div>🖼️</div><h4 data-i18n="relatedTool1">Image Editor</h4><p data-i18n="relatedTool1Desc">Crop and enhance images before OCR extraction.</p></a><a class="related" href="pdf-to-image.html"><div>📄</div><h4 data-i18n="relatedTool2">PDF to Image</h4><p data-i18n="relatedTool2Desc">Convert PDF pages to images, then run OCR.</p></a><a class="related" href="chinese-converter.html"><div>🔤</div><h4 data-i18n="relatedTool3">Chinese Converter</h4><p data-i18n="relatedTool3Desc">Convert OCR text between simplified and traditional.</p></a><a class="related" href="csv-json.html"><div>🔁</div><h4 data-i18n="relatedTool4">CSV JSON Converter</h4><p data-i18n="relatedTool4Desc">Transform extracted text data for developer workflows.</p></a></div></section>
</div>
<script src="https://cdn.jsdelivr.net/npm/tesseract.js@5/dist/tesseract.min.js"></script>
<script>
(function(){
'use strict';
var i18n={
en:{tool_name:'OCR Tool',title:'OCR Tool',subtitle:'Extract text from image online with browser OCR',choose:'Choose Image',extract:'Extract Text',copy:'Copy Text',clear:'Clear',inputPanel:'Image Input',outputPanel:'OCR Result',dropHint:'Drag and drop image here or click Choose Image',resultPlaceholder:'Recognized text appears here...',noFile:'Please choose an image first',processing:'OCR running...',done:'OCR completed',copied:'Copied to clipboard',trust_users:'🌍 Used by 50,000+ users',trust_rating:'⭐ 4.9/5 rating',trust_privacy:'🔒 100% Private',trust_free:'🚫 No Ads, No Signup',features_title:'OCR Tool Features',f1_t:'100% Free & Private',f1_d:'No ads, no signup, no watermark. Everything runs locally in your browser. Your data never leaves your device.',f2_t:'Image to Text OCR',f2_d:'Convert screenshots, scans, and photos into editable text with OCR online.',f3_t:'Multi-language Recognition',f3_d:'Choose OCR language mode for English, Chinese, French, and Spanish text extraction.',f4_t:'One-click Copy',f4_d:'Copy recognized text instantly for translation, search, notes, and document reuse.',faq_title:'Frequently Asked Questions',faq1_q:'What is OCR and what is it used for?',faq1_a:'OCR means Optical Character Recognition. It converts text in screenshots, scans, and photos into editable text for search, translation, and documentation workflows.',faq2_q:'Can this OCR tool extract text from screenshots and scanned PDFs?',faq2_a:'Yes. This image to text converter works well for screenshots and scanned document images. For PDFs, convert pages to images first, then run OCR online.',faq3_q:'Which OCR languages are supported?',faq3_a:'The tool provides common OCR language modes like English, Chinese, French, and Spanish. Pick the closest language to improve text recognition accuracy.',faq4_q:'Is OCR processing private and local?',faq4_a:'Yes. OCR runs in your browser with local processing logic and no account requirement. Image files are not uploaded by this page to any app server.',faq_free_q:'Is this tool really free with no ads?',faq_free_a:'Yes, 100% free with no ads, no registration, no watermark, and no usage limits. All processing happens locally in your browser — your data is never uploaded to any server.',relatedToolsTitle:'Related Tools',relatedTool1:'Image Editor',relatedTool1Desc:'Crop and enhance images before OCR extraction.',relatedTool2:'PDF to Image',relatedTool2Desc:'Convert PDF pages to images, then run OCR.',relatedTool3:'Chinese Converter',relatedTool3Desc:'Convert OCR text between simplified and traditional.',relatedTool4:'CSV JSON Converter',relatedTool4Desc:'Transform extracted text data for developer workflows.'},
'zh-CN':{tool_name:'OCR 图片文字识别',title:'OCR 图片文字识别',subtitle:'在浏览器中将图片快速转换为可编辑文本',choose:'选择图片',extract:'开始识别',copy:'复制文本',clear:'清空',inputPanel:'图片输入',outputPanel:'识别结果',dropHint:'拖拽图片到此处,或点击“选择图片”',resultPlaceholder:'识别文本会显示在这里...',noFile:'请先选择图片文件',processing:'正在执行 OCR 识别...',done:'识别完成',copied:'已复制到剪贴板',trust_users:'🌍 超过 50,000 用户使用',trust_rating:'⭐ 4.9/5 好评',trust_privacy:'🔒 100% 隐私安全',trust_free:'🚫 无广告、无需注册',features_title:'OCR 功能特点',f1_t:'100% 免费且安全',f1_d:'无广告、无需注册、无水印。所有处理都在浏览器本地完成,数据不会上传到任何服务器。',f2_t:'图片转文字 OCR',f2_d:'支持截图、扫描件、拍照图片的 image to text 识别。',f3_t:'多语言识别',f3_d:'可切换英文、中文、法语、西班牙语 OCR 识别模式。',f4_t:'一键复制',f4_d:'识别后可立即复制,用于翻译、检索和文档整理。',faq_title:'常见问题',faq1_q:'什么是 OCR?OCR 有什么用?',faq1_a:'OCR 即光学字符识别,可把图片里的文字变成可编辑文本。常见于截图转文字、纸质文档数字化、图片内容检索等场景。',faq2_q:'这个工具能识别截图和扫描件吗?',faq2_a:'可以。该 OCR online 工具适合截图和扫描图片。若是 PDF,可先转成图片后再做图片文字识别。',faq3_q:'支持哪些 OCR 语言?',faq3_a:'支持常用 OCR 语言模式,如英文、中文、法语、西班牙语。选择与文本最接近的语言,可提升识别准确率。',faq4_q:'识别过程是本地和隐私安全吗?',faq4_a:'是的。识别逻辑在浏览器本地执行,无需账号。页面不会主动把你的图片上传到应用服务器。',faq_free_q:'这个工具真的免费且无广告吗?',faq_free_a:'是的,100% 免费,无广告、无需注册、无水印、无限制。所有处理都在浏览器本地完成,你的数据不会上传到任何服务器。',relatedToolsTitle:'相关工具',relatedTool1:'图片编辑器',relatedTool1Desc:'先裁剪增强图片,再进行 OCR。',relatedTool2:'PDF 转图片',relatedTool2Desc:'先把 PDF 页转图,再识别文字。',relatedTool3:'简繁转换',relatedTool3Desc:'对 OCR 结果进行简繁互转处理。',relatedTool4:'CSV JSON 转换',relatedTool4Desc:'把提取文本进一步结构化处理。'},
fr:{tool_name:'Outil OCR',title:'Outil OCR',subtitle:'Extraire le texte d image en ligne avec OCR navigateur',choose:'Choisir une image',extract:'Extraire le texte',copy:'Copier le texte',clear:'Effacer',inputPanel:'Entrée image',outputPanel:'Résultat OCR',dropHint:'Glissez une image ici ou cliquez sur Choisir',resultPlaceholder:'Le texte reconnu apparaît ici...',noFile:'Veuillez choisir une image',processing:'OCR en cours...',done:'OCR terminé',copied:'Copié dans le presse-papiers',trust_users:'🌍 Utilisé par 50 000+ utilisateurs',trust_rating:'⭐ Note 4.9/5',trust_privacy:'🔒 100% Privé',trust_free:'🚫 Sans pub, sans inscription',features_title:'Fonctionnalités OCR',f1_t:'100% Gratuit et Privé',f1_d:'Sans publicité, sans inscription, sans filigrane. Tout est traité localement dans votre navigateur.',f2_t:'OCR image vers texte',f2_d:'Convertissez captures, scans et photos en texte éditable.',f3_t:'Reconnaissance multilingue',f3_d:'Modes OCR anglais, chinois, français et espagnol.',f4_t:'Copie en un clic',f4_d:'Copiez immédiatement le texte reconnu pour vos flux.',faq_title:'Questions fréquentes',faq1_q:'Qu est ce que OCR et a quoi sert il ?',faq1_a:'OCR signifie reconnaissance optique de caracteres. Cette technologie convertit le texte present dans une image en texte editable pour recherche et documentation.',faq2_q:'Puis je extraire du texte depuis capture et scan ?',faq2_a:'Oui. Cet outil image to text fonctionne avec captures d ecran et scans. Pour PDF, convertissez d abord en image puis lancez OCR.',faq3_q:'Quelles langues OCR sont disponibles ?',faq3_a:'Le tool propose des modes OCR courants: anglais, chinois, francais et espagnol. Choisissez la langue la plus proche pour une meilleure precision.',faq4_q:'Le traitement OCR est il local et prive ?',faq4_a:'Oui. Le traitement fonctionne dans le navigateur et n exige pas de compte. Vos images ne sont pas envoyees a un serveur applicatif.',faq_free_q:'Cet outil est-il vraiment gratuit et sans pub ?',faq_free_a:'Oui, 100% gratuit, sans publicité, sans inscription, sans filigrane et sans limites. Tout est traité localement dans votre navigateur — vos données ne sont jamais téléversées.',relatedToolsTitle:'Outils associés',relatedTool1:'Éditeur d image',relatedTool1Desc:'Recadrez l image avant OCR.',relatedTool2:'PDF vers image',relatedTool2Desc:'Convertissez PDF en image puis OCR.',relatedTool3:'Convertisseur chinois',relatedTool3Desc:'Convertissez texte OCR simplifie/traditionnel.',relatedTool4:'Convertisseur CSV JSON',relatedTool4Desc:'Structurer le texte extrait.'},
es:{tool_name:'Herramienta OCR',title:'Herramienta OCR',subtitle:'Extrae texto de imagen en línea con OCR en navegador',choose:'Elegir imagen',extract:'Extraer texto',copy:'Copiar texto',clear:'Limpiar',inputPanel:'Entrada de imagen',outputPanel:'Resultado OCR',dropHint:'Arrastra imagen aquí o haz clic en Elegir imagen',resultPlaceholder:'El texto reconocido aparece aquí...',noFile:'Primero selecciona una imagen',processing:'OCR en progreso...',done:'OCR completado',copied:'Copiado al portapapeles',trust_users:'🌍 Usado por más de 50,000 usuarios',trust_rating:'⭐ Calificación 4.9/5',trust_privacy:'🔒 100% Privado',trust_free:'🚫 Sin anuncios, sin registro',features_title:'Funciones OCR',f1_t:'100% Gratis y Privado',f1_d:'Sin anuncios, sin registro, sin marca de agua. Todo se procesa localmente en tu navegador.',f2_t:'OCR imagen a texto',f2_d:'Convierte capturas, escaneos y fotos en texto editable.',f3_t:'Reconocimiento multilenguaje',f3_d:'Modos OCR para inglés, chino, francés y español.',f4_t:'Copiar con un clic',f4_d:'Copia el texto reconocido para buscar, traducir y documentar.',faq_title:'Preguntas frecuentes',faq1_q:'¿Qué es OCR y para qué sirve?',faq1_a:'OCR significa reconocimiento óptico de caracteres. Convierte texto dentro de imágenes en texto editable para búsqueda, traducción y documentación.',faq2_q:'¿Puede extraer texto de capturas y escaneos?',faq2_a:'Sí. Este image to text converter funciona con capturas y escaneos. Para PDF, convierte primero a imagen y luego ejecuta OCR online.',faq3_q:'¿Qué idiomas OCR soporta?',faq3_a:'Incluye modos OCR comunes como inglés, chino, francés y español. Elegir el idioma correcto mejora la precisión de reconocimiento.',faq4_q:'¿El procesamiento OCR es local y privado?',faq4_a:'Sí. El procesamiento ocurre en el navegador y no requiere cuenta. Tus imágenes no se suben a un servidor de aplicación.',faq_free_q:'¿Esta herramienta es realmente gratis y sin anuncios?',faq_free_a:'Sí, 100% gratis, sin anuncios, sin registro, sin marca de agua y sin límites. Todo el procesamiento ocurre localmente en tu navegador: tus datos nunca se suben a ningún servidor.',relatedToolsTitle:'Herramientas relacionadas',relatedTool1:'Editor de imagen',relatedTool1Desc:'Recorta y mejora la imagen antes de OCR.',relatedTool2:'PDF a imagen',relatedTool2Desc:'Convierte PDF a imagen y luego aplica OCR.',relatedTool3:'Convertidor chino',relatedTool3Desc:'Convierte texto OCR entre simplificado/tradicional.',relatedTool4:'Convertidor CSV JSON',relatedTool4Desc:'Estructura los datos de texto extraído.'}
};
var fileInput=document.getElementById('fileInput');
var preview=document.getElementById('preview');
var resultText=document.getElementById('resultText');
var statusEl=document.getElementById('status');
var fileNameEl=document.getElementById('fileName');
var dropZone=document.getElementById('dropZone');
var currentFile=null;
function getLang(){return window.WebToolbox?window.WebToolbox.getCurrentLang():'en'}
function t(k){var d=window._translations[getLang()]||window._translations.en;return d[k]||window._translations.en[k]||k}
function setStatus(v){statusEl.textContent=v||''}
function setFile(file){
currentFile=file;
if(!file){preview.style.display='none';preview.src='';fileNameEl.textContent='';return;}
fileNameEl.textContent=file.name+' ('+Math.round(file.size/1024)+' KB)';
var url=URL.createObjectURL(file);
preview.src=url;
preview.style.display='block';
}
document.getElementById('chooseBtn').addEventListener('click',function(){fileInput.click();});
fileInput.addEventListener('change',function(){if(fileInput.files&&fileInput.files[0])setFile(fileInput.files[0]);});
['dragenter','dragover'].forEach(function(ev){dropZone.addEventListener(ev,function(e){e.preventDefault();dropZone.classList.add('drag');});});
['dragleave','drop'].forEach(function(ev){dropZone.addEventListener(ev,function(e){e.preventDefault();dropZone.classList.remove('drag');});});
dropZone.addEventListener('drop',function(e){var f=e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files[0];if(f&&f.type.startsWith('image/')){setFile(f);}});
document.getElementById('extractBtn').addEventListener('click',async function(){
if(!currentFile){setStatus(t('noFile'));return;}
setStatus(t('processing'));
resultText.value='';
try{
var lang=document.getElementById('langSel').value;
var out=await Tesseract.recognize(currentFile,lang,{logger:function(m){if(m&&m.progress){setStatus(t('processing')+' '+Math.round(m.progress*100)+'%')}}});
resultText.value=(out&&out.data&&out.data.text)||'';
setStatus(t('done'));
}catch(e){setStatus('OCR Error: '+(e.message||e));}
});
document.getElementById('copyBtn').addEventListener('click',function(){navigator.clipboard.writeText(resultText.value||'').then(function(){setStatus(t('copied'));});});
document.getElementById('clearBtn').addEventListener('click',function(){setFile(null);resultText.value='';setStatus('');fileInput.value='';});
window._translations=i18n;
})();
</script>
<script src="common/common.js" data-tool-id="ocr-tool" data-tool-name="OCR Tool" data-category="image"></script>
<script>WebToolbox.init(window._translations);</script>
</body>
</html>