Here is a complete responsive QR Code Decoder Tool using HTML, CSS and JavaScript. It supports image upload, drag & drop, camera scanning, paste image, decode result, copy, open link, download result, clear, and scan history. It uses the free jsQR library.
QR Code Decoder Tool - Scan & Read QR Codes Online
🖼️ Upload QR Code
📷 Scan with Camera
📷 Start Camera
⏹ Stop Camera
🔄 Switch Camera
📋 Copy
🔗 Open Link
⬇️ Download Result
🗑 Clear Result
🖼️
Image Decoder
Upload QR code images and decode them instantly.
📷
Camera Scanner
Use your device camera to scan QR codes.
🔒
Private
Your QR image is processed directly in your browser.
QR Code Decoder Tool • Free online QR scanner •
Works on mobile, tablet and desktop.
*{
margin:0;
padding:0;
box-sizing:border-box;
}
:root{
--primary:#6d28d9;
--secondary:#ec4899;
--blue:#2563eb;
--green:#059669;
--red:#dc2626;
--dark:#172033;
--muted:#64748b;
--light:#f8fafc;
--border:#e2e8f0;
}
body{
font-family:Arial,Helvetica,sans-serif;
min-height:100vh;
background:
radial-gradient(circle at top left,#ddd6fe 0,transparent 35%),
radial-gradient(circle at bottom right,#fbcfe8 0,transparent 35%),
linear-gradient(135deg,#f8fafc,#eef2ff);
color:var(--dark);
padding:20px;
}
.container{
width:100%;
max-width:1050px;
margin:auto;
}
.header{
text-align:center;
margin-bottom:25px;
}
.logo{
width:70px;
height:70px;
margin:0 auto 15px;
border-radius:20px;
display:flex;
justify-content:center;
align-items:center;
font-size:36px;
background:linear-gradient(135deg,var(--primary),var(--secondary));
box-shadow:0 12px 30px rgba(109,40,217,.25);
}
.header h1{
font-size:clamp(28px,5vw,44px);
margin-bottom:10px;
background:linear-gradient(
90deg,
var(--primary),
var(--secondary),
var(--blue)
);
-webkit-background-clip:text;
background-clip:text;
color:transparent;
}
.header p{
color:var(--muted);
font-size:15px;
line-height:1.6;
}
.tool{
background:rgba(255,255,255,.96);
border:1px solid rgba(255,255,255,.8);
border-radius:24px;
padding:22px;
box-shadow:0 20px 55px rgba(15,23,42,.12);
}
/* Tabs */
.tabs{
display:grid;
grid-template-columns:1fr 1fr;
gap:10px;
margin-bottom:20px;
}
.tab{
border:none;
padding:15px;
border-radius:13px;
cursor:pointer;
font-size:15px;
font-weight:bold;
color:#475569;
background:#f1f5f9;
transition:.25s;
}
.tab:hover{
transform:translateY(-2px);
}
.tab.active{
color:white;
background:linear-gradient(
135deg,
var(--primary),
var(--secondary)
);
box-shadow:0 8px 20px rgba(109,40,217,.25);
}
.panel{
display:none;
}
.panel.active{
display:block;
}
/* Upload */
.upload-box{
border:3px dashed #cbd5e1;
border-radius:18px;
padding:45px 20px;
text-align:center;
background:linear-gradient(135deg,#faf5ff,#eff6ff);
transition:.25s;
}
.upload-box.dragover{
border-color:var(--primary);
background:#f5f3ff;
transform:scale(1.01);
}
.upload-icon{
font-size:55px;
margin-bottom:12px;
}
.upload-box h2{
margin-bottom:8px;
font-size:22px;
}
.upload-box p{
color:var(--muted);
margin-bottom:20px;
line-height:1.5;
}
.file-input{
display:none;
}
.btn{
border:none;
padding:12px 18px;
border-radius:11px;
cursor:pointer;
font-weight:bold;
font-size:14px;
transition:.2s;
display:inline-flex;
justify-content:center;
align-items:center;
gap:7px;
}
.btn:hover{
transform:translateY(-2px);
}
.btn-primary{
color:white;
background:linear-gradient(135deg,var(--primary),var(--secondary));
}
.btn-blue{
color:white;
background:linear-gradient(135deg,#2563eb,#0891b2);
}
.btn-green{
color:white;
background:linear-gradient(135deg,#059669,#10b981);
}
.btn-red{
color:white;
background:linear-gradient(135deg,#dc2626,#f97316);
}
.btn-light{
background:#e2e8f0;
color:#334155;
}
/* Image preview */
.preview-section{
display:none;
margin-top:20px;
}
.preview-title{
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:10px;
gap:10px;
}
.preview-title h3{
font-size:18px;
}
.image-container{
position:relative;
background:#0f172a;
border-radius:16px;
padding:12px;
text-align:center;
overflow:hidden;
}
#previewImage{
max-width:100%;
max-height:420px;
display:block;
margin:auto;
border-radius:10px;
}
#scanCanvas{
display:none;
}
/* Camera */
.camera-box{
background:#0f172a;
border-radius:18px;
padding:12px;
overflow:hidden;
}
.video-wrapper{
position:relative;
width:100%;
overflow:hidden;
border-radius:12px;
background:#020617;
}
#video{
display:block;
width:100%;
max-height:500px;
object-fit:cover;
}
.scan-frame{
position:absolute;
width:60%;
max-width:280px;
aspect-ratio:1;
top:50%;
left:50%;
transform:translate(-50%,-50%);
border:3px solid #22c55e;
border-radius:20px;
box-shadow:
0 0 0 9999px rgba(0,0,0,.35);
}
.scan-line{
position:absolute;
width:80%;
height:3px;
background:#22c55e;
left:10%;
top:50%;
animation:scan 2s infinite ease-in-out;
}
@keyframes scan{
0%,100%{
transform:translateY(-100px);
}
50%{
transform:translateY(100px);
}
}
.camera-controls{
display:flex;
flex-wrap:wrap;
justify-content:center;
gap:10px;
margin-top:15px;
}
/* Result */
.result{
margin-top:22px;
padding:18px;
border-radius:17px;
background:#f8fafc;
border:1px solid var(--border);
display:none;
}
.result.success{
border:2px solid #86efac;
background:#f0fdf4;
}
.result.error{
border:2px solid #fecaca;
background:#fef2f2;
}
.result-header{
display:flex;
align-items:center;
justify-content:space-between;
gap:10px;
margin-bottom:12px;
}
.result-header h2{
font-size:19px;
}
.status{
font-size:12px;
padding:6px 10px;
border-radius:20px;
font-weight:bold;
}
.status.success{
color:#166534;
background:#dcfce7;
}
.status.error{
color:#991b1b;
background:#fee2e2;
}
.result-text{
width:100%;
min-height:100px;
padding:14px;
border-radius:12px;
border:1px solid var(--border);
background:white;
color:#334155;
font-size:15px;
line-height:1.6;
word-break:break-word;
white-space:pre-wrap;
}
.result-buttons{
display:flex;
flex-wrap:wrap;
gap:10px;
margin-top:13px;
}
/* Information */
.info-grid{
display:grid;
grid-template-columns:repeat(3,1fr);
gap:12px;
margin-top:22px;
}
.info-card{
padding:17px;
background:#f8fafc;
border:1px solid var(--border);
border-radius:14px;
text-align:center;
}
.info-card span{
display:block;
font-size:28px;
margin-bottom:8px;
}
.info-card h3{
font-size:15px;
margin-bottom:5px;
}
.info-card p{
color:var(--muted);
font-size:12px;
line-height:1.5;
}
/* History */
.history{
margin-top:22px;
display:none;
}
.history h2{
font-size:19px;
margin-bottom:12px;
}
.history-list{
display:grid;
gap:9px;
}
.history-item{
display:flex;
justify-content:space-between;
align-items:center;
gap:10px;
padding:12px;
border:1px solid var(--border);
border-radius:11px;
background:#fff;
}
.history-text{
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
font-size:13px;
color:#475569;
}
.delete-history{
border:none;
background:#fee2e2;
color:#991b1b;
width:32px;
height:32px;
border-radius:8px;
cursor:pointer;
}
/* Footer */
footer{
text-align:center;
margin-top:22px;
color:#64748b;
font-size:13px;
line-height:1.6;
}
/* Responsive */
@media(max-width:700px){
body{
padding:10px;
}
.tool{
padding:14px;
border-radius:18px;
}
.tabs{
grid-template-columns:1fr;
}
.info-grid{
grid-template-columns:1fr;
}
.upload-box{
padding:35px 15px;
}
.camera-controls .btn,
.result-buttons .btn{
flex:1 1 45%;
}
}
@media(max-width:430px){
.header h1{
font-size:29px;
}
.camera-controls .btn,
.result-buttons .btn{
width:100%;
flex:1 1 100%;
}
.preview-title{
align-items:flex-start;
flex-direction:column;
}
}
🖼️ Upload QR Code
📷 Scan with Camera
📷 Start Camera
⏹ Stop Camera
🔄 Switch Camera
📋 Copy
🔗 Open Link
⬇️ Download Result
🗑 Clear Result
🖼️
Image Decoder
Upload QR code images and decode them instantly.
📷
Camera Scanner
Use your device camera to scan QR codes.
🔒
Private
Your QR image is processed directly in your browser.
QR Code Decoder Tool • Free online QR scanner •
Works on mobile, tablet and desktop.
Main features included
📷 Live camera QR scanner
🔄 Front/rear camera switch
🖼️ Upload QR image
📁 Drag-and-drop image upload
🔍 Automatic QR detection
🔗 Open decoded URLs
📋 Copy decoded text
⬇️ Download decoded result as TXT
🕘 Scan history using localStorage
🗑️ Clear result and history items
📱 Fully responsive mobile design
🎨 Colourful modern interface
🔒 Client-side processing
🔁 Supports QR codes with inverted colours using attemptBoth
📦 Uses the free jsQR library from jsDelivr
🌐 Works without your own backend/server
0 comments:
Post a Comment