-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
483 lines (462 loc) · 24.8 KB
/
index.html
File metadata and controls
483 lines (462 loc) · 24.8 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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Binary Code Translator - Online Free Tool</title>
<meta name="description" content="Free online interactive binary code translator! Instantly convert text to binary or binary to text—no registration required, unlimited use.">
<link rel="canonical" href="https://binary-code-translator.com/">
<!-- Open Graph Meta Tags -->
<meta property="og:title" content="Binary Code Translator - Online Free Tool">
<meta property="og:description" content="Translate text to binary and binary to text instantly. A professional, free, and privacy-focused tool.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://binary-code-translator.com/">
<!-- Twitter Card Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Binary Code Translator - Online Free Tool">
<meta name="twitter:description" content="Translate text to binary and binary to text instantly.">
<!-- Structured Data -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "Binary Code Translator",
"description": "Free online tool to convert text to binary code and binary to text",
"url": "https://binary-code-translator.com/",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Any",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
}
}
</script>
<link rel="stylesheet" href="css/style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<style>
/* Mobile Optimization */
@media (max-width: 768px) {
.container { padding: 0 1rem; }
.converter-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.quick-actions { width: 100%; justify-content: flex-end; margin-top: -2rem; }
.input-actions, .output-actions { flex-wrap: wrap; gap: 0.5rem; }
.input-actions .btn, .output-actions .btn { flex: 1 1 40%; justify-content: center; }
.features-grid, .examples-grid { grid-template-columns: 1fr; }
.table-wrapper {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
margin-bottom: 1rem;
border: 1px solid #e5e7eb;
border-radius: 0.5rem;
}
table { width: 100%; min-width: 300px; }
/* Adjust header font sizes */
h1 { font-size: 1.25rem; }
h2 { font-size: 1.125rem; }
.tagline { font-size: 0.75rem; }
}
</style>
</head>
<body data-mode="text-binary">
<header>
<div class="container">
<div class="nav-wrapper">
<div class="logo">
<h1><a href="/">Binary Code Translator</a></h1>
<div class="tagline">Professional Text to Binary Converter - Free Online Tool</div>
</div>
<button class="mobile-menu-toggle" id="mobileMenuToggle">☰</button>
<nav>
<ul>
<li><a href="/" class="active">Binary Translator</a></li>
<li>
<a href="#" onclick="return false;">
Number Base Converters
<span class="dropdown-arrow"></span>
</a>
<div class="dropdown">
<div class="dropdown-item">
<div class="dropdown-category">Binary Converters</div>
<a href="binary-to-decimal.html">
Binary ↔ Decimal
<div class="dropdown-description">Convert between base-2 and base-10</div>
</a>
<a href="binary-to-hex.html">
Binary ↔ Hexadecimal
<div class="dropdown-description">Convert between base-2 and base-16</div>
</a>
</div>
<div class="dropdown-item">
<div class="dropdown-category">Multi-Base Converters</div>
<a href="base-converter.html">
Base 2-62 Converter
<div class="dropdown-description">Convert between any bases 2-62</div>
</a>
</div>
</div>
</li>
<li>
<a href="#" onclick="return false;">
Developer Tools
<span class="dropdown-arrow"></span>
</a>
<div class="dropdown">
<div class="dropdown-item">
<div class="dropdown-category">Encoding</div>
<a href="base64-encoder.html">
Base64 Encoder/Decoder
<div class="dropdown-description">Encode and decode Base64 strings</div>
</a>
<a href="url-encoder.html">
URL Encoder/Decoder
<div class="dropdown-description">Encode and decode URLs</div>
</a>
<a href="#" onclick="alert('Coming soon!'); return false;" style="opacity: 0.6;">
HTML Entity Encoder
<div class="dropdown-description">Convert HTML to entities</div>
</a>
</div>
<div class="dropdown-item">
<div class="dropdown-category">Hash Functions</div>
<a href="#" onclick="alert('Coming soon!'); return false;" style="opacity: 0.6;">
MD5 Hash Generator
<div class="dropdown-description">Generate MD5 checksums</div>
</a>
<a href="#" onclick="alert('Coming soon!'); return false;" style="opacity: 0.6;">
SHA256 Generator
<div class="dropdown-description">Generate SHA256 hashes</div>
</a>
</div>
<div class="dropdown-item">
<div class="dropdown-category">Formatters</div>
<a href="#" onclick="alert('Coming soon!'); return false;" style="opacity: 0.6;">
JSON Formatter
<div class="dropdown-description">Format and validate JSON</div>
</a>
<a href="#" onclick="alert('Coming soon!'); return false;" style="opacity: 0.6;">
XML Formatter
<div class="dropdown-description">Format and validate XML</div>
</a>
</div>
</div>
</li>
<li><a href="blog/index.html">Blog</a></li>
</ul>
</nav>
</div>
</div>
</header>
<main class="container">
<section class="converter-section">
<div class="converter-box">
<div class="converter-header">
<h2>Binary Code Translator</h2>
<div class="quick-actions">
<button id="btnSwap" class="btn btn-icon" title="Swap Input/Output" aria-label="Swap Input and Output">⇄</button>
<button id="btnHistory" class="btn btn-icon" title="View History" aria-label="View Conversion History">📜</button>
</div>
</div>
<div class="conversion-indicator" id="converterIndicator" style="display: none;"></div>
<div class="input-group">
<div class="label-container">
<label id="labelLeft" for="inputLeft">
<span class="label-icon">📝</span>
<span class="label-text">Text Input</span>
</label>
<div class="stats-container">
<span class="char-count" id="charCountLeft">0 chars</span>
<span class="word-count" id="wordCountLeft">0 words</span>
<span class="line-count" id="lineCountLeft">0 lines</span>
</div>
</div>
<div class="input-wrapper">
<textarea id="inputLeft" placeholder="Type or paste your text here... Example: Hello World" autofocus></textarea>
<div id="dragOverlay" class="drag-overlay">
📁 Drop file here to convert
</div>
</div>
<div class="input-actions">
<button class="btn btn-copy" data-target="inputLeft">
<span class="btn-icon">📋</span>
Copy Text
</button>
<button class="btn btn-paste" data-target="inputLeft">
<span class="btn-icon">📥</span>
Paste
</button>
<label class="btn btn-upload">
<span class="btn-icon">📁</span>
Upload File
<input type="file" id="fileUpload" style="display:none;" accept=".txt,.json,.xml,.csv">
</label>
<button class="btn btn-clear" data-target="inputLeft">
<span class="btn-icon">🗑️</span>
Clear
</button>
</div>
</div>
<div class="input-group">
<div class="label-container">
<label id="labelRight" for="inputRight">
<span class="label-icon">💻</span>
<span class="label-text">Binary Output</span>
</label>
<div class="stats-container">
<span class="char-count" id="charCountRight">0 bits</span>
<span class="word-count" id="wordCountRight">0 bytes</span>
<span class="line-count" id="lineCountRight">0 lines</span>
</div>
</div>
<div class="input-wrapper">
<textarea id="inputRight" placeholder="Binary translation will appear here... Example: 01001000 01100101 01101100 01101100 01101111" readonly></textarea>
</div>
<div class="output-actions">
<button class="btn btn-copy" data-target="inputRight">
<span class="btn-icon">📋</span>
Copy Binary
</button>
<button id="btnDownload" class="btn">
<span class="btn-icon">💾</span>
Download
</button>
<button id="btnShare" class="btn">
<span class="btn-icon">🔗</span>
Share
</button>
</div>
</div>
<div id="errorMsg" class="error-msg"></div>
</div>
</section>
<!-- Features Section -->
<section class="features-section collapsible-section">
<div class="section-header" data-target="features">
<h2 class="section-title">Key Features</h2>
<span class="section-toggle">▼</span>
</div>
<div class="section-content" id="features">
<div class="features-grid">
<div class="feature-card">
<div class="feature-icon">⚡</div>
<h3>Instant Translation</h3>
<p>Convert text to binary and binary to text in real-time as you type. No waiting, no page reloads.</p>
</div>
<div class="feature-card">
<div class="feature-icon">🔄</div>
<h3>Bidirectional Conversion</h3>
<p>Easily swap between text-to-binary and binary-to-text modes with a single click.</p>
</div>
<div class="feature-card">
<div class="feature-icon">🌍</div>
<h3>Unicode Support</h3>
<p>Full support for UTF-8 characters, including emojis, special symbols, and multiple languages.</p>
</div>
<div class="feature-card">
<div class="feature-icon">📁</div>
<h3>File Processing</h3>
<p>Upload text files to convert large amounts of content instantly. Supports .txt, .json, and more.</p>
</div>
<div class="feature-card">
<div class="feature-icon">💾</div>
<h3>History & Favorites</h3>
<p>Automatically saves your recent translations. Mark important conversions as favorites for quick access.</p>
</div>
<div class="feature-card">
<div class="feature-icon">🔒</div>
<h3>Privacy Focused</h3>
<p>All translations happen locally in your browser. Your text and data never leave your device.</p>
</div>
</div>
</div>
</section>
<!-- How to Use Section -->
<section class="how-to-section collapsible-section">
<div class="section-header" data-target="howto">
<h2 class="section-title">How to Use Binary Code Translator</h2>
<span class="section-toggle">▼</span>
</div>
<div class="section-content" id="howto">
<div class="steps-container">
<div class="step-item">
<div class="step-number">1</div>
<div class="step-content">
<h3>📝 Enter Your Text</h3>
<p>Type or paste the text you want to convert into the left box. You can also upload a text file.</p>
</div>
</div>
<div class="step-item">
<div class="step-number">2</div>
<div class="step-content">
<h3>⚡ View Result</h3>
<p>The binary code will appear instantly in the right box. If you enter binary, it will convert back to text.</p>
</div>
</div>
<div class="step-item">
<div class="step-number">3</div>
<div class="step-content">
<h3>💾 Copy or Download</h3>
<p>Click "Copy" to grab the result, or "Download" to save it as a text file for later use.</p>
</div>
</div>
</div>
</div>
</section>
<!-- Examples Section -->
<section class="examples-section collapsible-section">
<div class="section-header" data-target="examples">
<h2 class="section-title">Binary Code Examples</h2>
<span class="section-toggle">▼</span>
</div>
<div class="section-content" id="examples">
<div class="examples-grid">
<div class="example-item">
<div class="example-preview">Hello</div>
<div class="example-code">01001000 01100101 01101100 01101100 01101111</div>
<button class="btn btn-example" data-text="Hello">Try it</button>
</div>
<div class="example-item">
<div class="example-preview">I love coding</div>
<div class="example-code">01001001 00100000 01101100 01101111 01110110 01100101 00100000 01100011 01101111 01100100 01101001 01101110 01100111</div>
<button class="btn btn-example" data-text="I love coding">Try it</button>
</div>
<div class="example-item">
<div class="example-preview">123</div>
<div class="example-code">00110001 00110010 00110011</div>
<button class="btn btn-example" data-text="123">Try it</button>
</div>
</div>
</div>
</section>
<!-- FAQ Section -->
<section class="faq-section collapsible-section">
<div class="section-header" data-target="faq">
<h2 class="section-title">Frequently Asked Questions</h2>
<span class="section-toggle">▼</span>
</div>
<div class="section-content" id="faq">
<div class="faq-container">
<div class="faq-item">
<div class="faq-question">
<h3>What is Binary Code?</h3>
<span class="faq-toggle">+</span>
</div>
<div class="faq-answer">
<p>Binary code is a system of representing text or computer processor instructions using the binary number system's two binary digits, 0 and 1.</p>
</div>
</div>
<div class="faq-item">
<div class="faq-question">
<h3>How do I translate text to binary?</h3>
<span class="faq-toggle">+</span>
</div>
<div class="faq-answer">
<p>Each character in your text is converted to its ASCII or Unicode numeric value, and then that number is converted to base-2 (binary). Our tool does this automatically.</p>
</div>
</div>
<div class="faq-item">
<div class="faq-question">
<h3>Is this translator free?</h3>
<span class="faq-toggle">+</span>
</div>
<div class="faq-answer">
<p>Yes, this binary code translator is 100% free to use for personal and commercial purposes.</p>
</div>
</div>
</div>
</div>
</section>
<!-- Educational Section -->
<section class="educational-section collapsible-section">
<div class="section-header" data-target="educational">
<h2 class="section-title">Learn Binary Code</h2>
<span class="section-toggle">▼</span>
</div>
<div class="section-content" id="educational">
<div class="educational-content">
<div class="edu-text">
<h3>How Binary Works</h3>
<p>Computers use binary (base-2) to store data. Everything you see on a screen—text, images, videos—is ultimately stored as a long sequence of 0s and 1s.</p>
<p>For text, we use encoding standards like ASCII. For example, the capital letter 'A' has the decimal value 65, which is <code>01000001</code> in binary.</p>
</div>
<div class="edu-visual">
<div class="binary-table">
<h4>ASCII Binary Examples</h4>
<div class="table-wrapper">
<table>
<tr><th>Character</th><th>Decimal</th><th>Binary</th></tr>
<tr><td>A</td><td>65</td><td>01000001</td></tr>
<tr><td>B</td><td>66</td><td>01000010</td></tr>
<tr><td>a</td><td>97</td><td>01100001</td></tr>
<tr><td>b</td><td>98</td><td>01100010</td></tr>
<tr><td>0</td><td>48</td><td>00110000</td></tr>
<tr><td>1</td><td>49</td><td>00110001</td></tr>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<footer>
<div class="container">
<div class="footer-content">
<div class="footer-section collapsed">
<h3>Binary Code Translator <span class="footer-toggle">▼</span></h3>
<div class="footer-toggle-content">
<p>Free online tool to translate text to binary and binary to text. Fast, secure, and easy to use.</p>
</div>
</div>
<div class="footer-section collapsed">
<h4>Tools <span class="footer-toggle">▼</span></h4>
<div class="footer-toggle-content">
<ul>
<li><a href="/" class="active">Binary Translator</a></li>
<li><a href="binary-to-decimal.html">Binary to Decimal</a></li>
<li><a href="binary-to-hex.html">Binary to Hex</a></li>
<li><a href="base-converter.html">Base Converter</a></li>
</ul>
</div>
</div>
<div class="footer-section collapsed">
<h4>Legal <span class="footer-toggle">▼</span></h4>
<div class="footer-toggle-content">
<ul>
<li><a href="legal/privacy.html">Privacy Policy</a></li>
<li><a href="legal/terms.html">Terms of Service</a></li>
<li><a href="legal/cookies.html">Cookie Policy</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-bottom">
<p>© 2025 Binary Code Translator. All rights reserved.</p>
<p>The most trusted binary translator online - Free, secure, and privacy-focused.</p>
</div>
</div>
</footer>
<!-- History Modal -->
<div id="historyModal" class="modal" style="display: none;">
<div class="modal-content">
<div class="modal-header">
<h2>Translation History</h2>
<div class="modal-header-actions">
<button id="clearHistory" class="btn btn-danger btn-sm">Clear History</button>
<button class="modal-close" id="closeHistory">×</button>
</div>
</div>
<div class="modal-body">
<div id="historyList" class="history-list">
<p class="no-history">No translation history yet</p>
</div>
</div>
</div>
</div>
<script src="js/converter.js"></script>
<script src="js/ui-controller.js"></script>
<script src="js/enhanced-ui.js"></script>
</body>
</html>