-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
721 lines (650 loc) · 44.3 KB
/
index.html
File metadata and controls
721 lines (650 loc) · 44.3 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
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Cache Control - Prevent browser caching of HTML -->
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<!-- Primary Meta Tags -->
<title>QueryJSON - Free Online JSON, XML, CSV Converter & SQL Query Tool</title>
<meta name="title" content="QueryJSON - Free Online JSON, XML, CSV Converter & SQL Query Tool">
<meta name="description" content="Free online tool to convert, query, and analyze JSON, XML, and CSV data. Transform data to interactive tables, run SQL queries with PostgreSQL, apply filters, and export results. No signup required, 100% browser-based and secure.">
<meta name="keywords" content="json viewer, json formatter, json to table, xml to json, csv to json, json converter, xml converter, csv converter, sql query tool, json parser, online json editor, json explorer, data converter, postgresql query, pglite, jsonpath query, free json tool, data analysis tool, json validator, csv parser, xml parser">
<meta name="author" content="Dinesh D">
<meta name="robots" content="index, follow">
<meta name="language" content="English">
<meta name="revisit-after" content="7 days">
<!-- Canonical URL -->
<link rel="canonical" href="https://queryjson.com/">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://queryjson.com/">
<meta property="og:title" content="QueryJSON - Free Online JSON, XML, CSV Converter & SQL Query Tool">
<meta property="og:description" content="Free online tool to convert, query, and analyze JSON, XML, and CSV data. Transform data to interactive tables, run SQL queries, apply filters, and export results. 100% browser-based and secure.">
<meta property="og:image" content="https://queryjson.com/static/images/og-image.png">
<meta property="og:site_name" content="QueryJSON">
<meta property="og:locale" content="en_US">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="https://queryjson.com/">
<meta name="twitter:title" content="QueryJSON - Free Online JSON, XML, CSV Converter & SQL Query Tool">
<meta name="twitter:description" content="Free online tool to convert, query, and analyze JSON, XML, and CSV data. Transform data to interactive tables, run SQL queries, and export results.">
<meta name="twitter:image" content="https://queryjson.com/static/images/twitter-card.png">
<meta name="twitter:creator" content="@dineshd">
<!-- Additional SEO Meta Tags -->
<meta name="theme-color" content="#007acc">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="QueryJSON">
<meta name="application-name" content="QueryJSON">
<meta name="msapplication-TileColor" content="#007acc">
<meta name="msapplication-config" content="static/images/browserconfig.xml">
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="static/images/favicon.ico">
<link rel="icon" type="image/png" sizes="32x32" href="static/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="static/images/favicon-16x16.png">
<link rel="apple-touch-icon" sizes="180x180" href="static/images/apple-touch-icon.png">
<link rel="manifest" href="static/images/site.webmanifest">
<!-- PGLite - PostgreSQL in the browser -->
<script type="module">
import { PGlite } from 'https://cdn.jsdelivr.net/npm/@electric-sql/pglite/dist/index.js';
window.PGlite = PGlite;
</script>
<!-- JSONPath library - using a simpler, more reliable library -->
<script src="https://cdn.jsdelivr.net/npm/jsonpath@1.1.1/jsonpath.min.js"></script>
<!-- Structured Data (JSON-LD) for SEO -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "QueryJSON",
"alternateName": "QueryJSON - JSON XML CSV Converter",
"url": "https://queryjson.com",
"description": "Free online tool to convert, query, and analyze JSON, XML, and CSV data. Transform data to interactive tables, run SQL queries with PostgreSQL, apply filters, and export results. No signup required, 100% browser-based and secure.",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Any (Web-based)",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"author": {
"@type": "Person",
"name": "Dinesh D",
"url": "https://github.com/dinesh-it"
},
"creator": {
"@type": "Person",
"name": "Dinesh D",
"url": "https://github.com/dinesh-it"
},
"publisher": {
"@type": "Organization",
"name": "QueryJSON",
"url": "https://queryjson.com"
},
"softwareVersion": "1.0",
"featureList": [
"JSON to Table Converter",
"XML to JSON Converter",
"CSV to JSON Converter",
"SQL Query with PostgreSQL (PGLite)",
"JSONPath Query Support",
"Interactive Data Filtering",
"Column Selection and Reordering",
"Data Export (CSV, JSON) and Copy (JSON, Markdown)",
"100% Client-side Processing",
"No Server Upload Required"
],
"browserRequirements": "Requires JavaScript. Works with modern browsers (Chrome, Firefox, Safari, Edge).",
"screenshot": "https://queryjson.com/static/images/screenshot.png",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.8",
"ratingCount": "150",
"bestRating": "5",
"worstRating": "1"
}
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "QueryJSON",
"applicationCategory": "WebApplication",
"operatingSystem": "Web Browser",
"offers": {
"@type": "Offer",
"price": "0"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.8",
"ratingCount": "150"
}
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What data formats are supported by QueryJSON?",
"acceptedAnswer": {
"@type": "Answer",
"text": "QueryJSON supports JSON, XML, and CSV formats. The tool automatically detects the format when you paste or upload data."
}
},
{
"@type": "Question",
"name": "Is my data secure? Is it sent to a server?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Your data is completely secure. All processing happens entirely in your browser using client-side JavaScript. No data is ever sent to any server or stored anywhere except your browser's memory."
}
},
{
"@type": "Question",
"name": "How do I query my data with SQL?",
"acceptedAnswer": {
"@type": "Answer",
"text": "After parsing your data, switch to the SQL tab in the QUERY section. Your data is available in a table called json_data. For example: SELECT * FROM json_data WHERE salary > 90000"
}
},
{
"@type": "Question",
"name": "Can I use QueryJSON offline?",
"acceptedAnswer": {
"@type": "Answer",
"text": "The tool requires an internet connection to load the external libraries (PGLite, JSONPath) on first load. However, once loaded, it can work offline for the duration of your session."
}
},
{
"@type": "Question",
"name": "Is QueryJSON free to use?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes! QueryJSON is completely free and open-source under the MIT License."
}
}
]
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://queryjson.com"
},
{
"@type": "ListItem",
"position": 2,
"name": "JSON Converter",
"item": "https://queryjson.com#json-converter"
},
{
"@type": "ListItem",
"position": 3,
"name": "XML Converter",
"item": "https://queryjson.com#xml-converter"
},
{
"@type": "ListItem",
"position": 4,
"name": "CSV Converter",
"item": "https://queryjson.com#csv-converter"
}
]
}
</script>
<!-- Styles -->
<link rel="stylesheet" href="static/css/styles.min.css?v=cef61b8f">
</head>
<body>
<div class="container">
<div class="header">
<h1><img src="static/images/favicon-32x32.png" alt="QueryJSON" style="vertical-align: middle; margin-right: 8px; width: 20px; height: 20px;"> QueryJSON</h1>
<div class="header-links">
<a href="#" onclick="openHelpModal(event); return false;" class="header-link">About</a>
<a href="#" onclick="openFAQModal(event); return false;" class="header-link">FAQ</a>
</div>
</div>
<div class="section-header">
<div style="display: flex; align-items: center; justify-content: space-between; padding: 8px 12px;">
<h2 style="margin: 0; font-size: 12px; color: var(--accent-primary); text-transform: uppercase;"><span class="section-icon"></span> INPUT • CHOOSE COLUMNS • FILTER</h2>
<button class="toggle-text-btn" id="topSectionToggle" onclick="toggleTopSection()">Hide Section</button>
</div>
</div>
<div class="main-grid" id="topSection">
<!-- Input Panel -->
<div class="panel" style="display: flex; flex-direction: column;">
<h2><span class="section-icon"></span> INPUT</h2>
<div class="panel-content">
<textarea id="jsonInput" placeholder='Paste JSON, XML, or CSV data here... JSON: {"key": "value"} XML: <root><item>data</item></root> CSV: name,age,city John,30,NYC' style="flex: 1; resize: none;"></textarea>
<div style="display: flex; gap: 6px; margin-top: 8px;">
<input type="file" id="fileInput" accept=".json,.xml,.csv,.txt" style="flex: 1; padding: 6px 8px; border: 1px solid var(--border-color); background: var(--bg-tertiary); color: var(--text-primary); border-radius: 4px; font-size: 12px; cursor: pointer;" />
<button class="btn-primary" onclick="parseJSON()">Parse</button>
<button class="btn-secondary" onclick="clearInput()">Clear</button>
</div>
<!-- Display Mode Selector (shown for complex nested structures) -->
<div id="displayModeSelector" class="hide" style="margin-top: 12px; padding: 10px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 4px;">
<div style="font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; display: flex; align-items: center; gap: 4px;">
<span style="color: var(--accent-primary);">ℹ️</span>
<strong>Complex nested structure detected</strong>
</div>
<div style="font-size: 11px; color: var(--text-secondary); margin-bottom: 8px;">
Choose how to display your data:
</div>
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
<label style="flex: 1; min-width: 200px; cursor: pointer; padding: 8px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 4px; display: flex; align-items: flex-start; gap: 8px; transition: border-color 0.2s;">
<input type="radio" name="displayMode" value="grouped" checked onchange="changeDisplayMode()" style="margin-top: 2px;">
<div>
<div style="font-size: 12px; font-weight: 500; margin-bottom: 2px;">Group by Array Items</div>
<div style="font-size: 10px; color: var(--text-secondary); line-height: 1.3;">One row per array element (Meter, ContactMethod). Clean tables with meaningful columns. Recommended.</div>
</div>
</label>
<label style="flex: 1; min-width: 200px; cursor: pointer; padding: 8px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 4px; display: flex; align-items: flex-start; gap: 8px; transition: border-color 0.2s;">
<input type="radio" name="displayMode" value="flattened" onchange="changeDisplayMode()" style="margin-top: 2px;">
<div>
<div style="font-size: 12px; font-weight: 500; margin-bottom: 2px;">Fully Flattened</div>
<div style="font-size: 10px; color: var(--text-secondary); line-height: 1.3;">One row per leaf value with Key1, Key2... columns showing full path. Very detailed.</div>
</div>
</label>
</div>
</div>
</div>
</div>
<!-- Configuration Panel -->
<div class="panel" id="configPanel">
<h2><span class="section-icon"></span> CHOOSE COLUMNS</h2>
<div class="panel-content">
<div id="columnSelector" class="column-selector hide" style="display: flex; flex-direction: column;">
<div class="button-group">
<button class="btn-secondary btn-sm" onclick="selectAllColumns()">All</button>
<button class="btn-secondary btn-sm" onclick="deselectAllColumns()">None</button>
</div>
<div id="columnList" class="column-list" style="max-height: 200px; overflow-y: auto;"></div>
</div>
</div>
</div>
<!-- Filter Panel -->
<div class="panel">
<h2><span class="section-icon"></span> FILTER</h2>
<div class="panel-content">
<div id="filterControls" class="filter-controls hide">
<div id="filterList"></div>
<div style="display: flex; gap: 6px;">
<button class="btn-primary" id="applyFilterBtn" onclick="applyFilters()" style="display: none;">Apply</button>
<button class="btn-secondary" onclick="addFilterRow()">+ Add</button>
</div>
</div>
<div class="stats" id="statsContainer" style="display: none;">
<div class="stat-card">
<div class="stat-value" id="statRows">0</div>
<div class="stat-label">Rows</div>
</div>
<div class="stat-card">
<div class="stat-value" id="statColumns">0</div>
<div class="stat-label">Cols</div>
</div>
<div class="stat-card">
<div class="stat-value" id="statFiltered">0</div>
<div class="stat-label">View</div>
</div>
</div>
<div id="detailsStatusMessage" class="status-message"></div>
<div id="detailsEmpty" style="color: var(--text-secondary); font-size: 12px; padding: 12px; text-align: center;">
Parse JSON to see details
</div>
</div>
</div>
</div>
<!-- Output Section -->
<div class="section-header">
<div style="display: flex; align-items: center; justify-content: space-between; padding: 8px 12px;">
<h2 style="margin: 0; font-size: 12px; color: var(--accent-primary); text-transform: uppercase;"><span class="section-icon"></span> OUTPUT</h2>
<button class="toggle-text-btn" id="outputSectionToggle" onclick="toggleOutputSection()">Hide Section</button>
</div>
</div>
<div class="panel" id="outputPanel">
<div class="panel-content" id="outputContent">
<div class="search-filter-container">
<div class="search-box">
<input type="text" id="searchInput" placeholder="Search..." onkeyup="applySearch()">
</div>
<div class="button-group">
<button class="btn-secondary" onclick="exportToCSV()" title="Download as CSV file">📥 CSV</button>
<button class="btn-secondary" onclick="exportToJSON()" title="Download as JSON file">📥 JSON</button>
<button class="btn-secondary" onclick="copyAsJSON()" title="Copy JSON to clipboard">📋 Copy JSON</button>
<button class="btn-secondary" onclick="copyAsMarkdown()" title="Copy Markdown table to clipboard">📋 Copy Markdown</button>
</div>
</div>
<div id="tableContainer" class="table-wrapper hide">
<table id="dataTable">
<thead id="tableHead"></thead>
<tbody id="tableBody"></tbody>
</table>
</div>
<div id="noData" class="no-data hide">
<p>No data. Parse JSON to start.</p>
</div>
</div>
</div>
<!-- Query Section -->
<div class="section-header">
<div style="display: flex; align-items: center; justify-content: space-between; padding: 8px 12px;">
<h2 style="margin: 0; font-size: 12px; color: var(--accent-primary); text-transform: uppercase;"><span class="section-icon"></span> QUERY</h2>
<button class="toggle-text-btn" id="querySectionToggle" onclick="toggleQuerySection()">Hide Section</button>
</div>
</div>
<div class="panel" style="min-height: 50px;" id="queryPanel">
<div class="panel-content" id="queryContent">
<div id="pgliteNotReady" style="text-align: center; color: var(--text-secondary); padding: 12px; font-size: 12px;">
Parse JSON to enable queries
</div>
<div id="querySection" class="hide">
<!-- Query Mode Selector -->
<div style="display: flex; gap: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px;">
<button class="query-mode-btn active" onclick="switchQueryMode('sql')" data-mode="sql">SQL</button>
<button class="query-mode-btn" onclick="switchQueryMode('jsonpath')" data-mode="jsonpath">JSONPath</button>
</div>
<!-- SQL Query Interface -->
<div id="sqlSection" class="query-mode-section">
<div style="display: flex; gap: 6px; margin-bottom: 8px; align-items: flex-start;">
<div style="flex: 1;">
<textarea id="sqlQuery" class="query-input" placeholder="SELECT * FROM json_data LIMIT 10;"></textarea>
<div style="margin-top: 6px; font-size: 11px; color: var(--text-secondary);">
<!-- Available Tables Info -->
<div id="availableTablesInfo" style="display: none; margin-bottom: 8px; padding: 6px 8px; background: var(--bg-tertiary); border-radius: 4px; border-left: 3px solid var(--accent-primary);">
<div style="font-weight: 600; margin-bottom: 4px;">Available Tables:</div>
<div id="tablesList" style="font-family: monospace; font-size: 10px;"></div>
</div>
<details style="cursor: pointer;">
<summary style="user-select: none;">Examples & Help</summary>
<div style="margin-top: 8px; padding: 8px; background: var(--bg-tertiary); border-radius: 4px; line-height: 1.6;">
<div><strong>Basic Queries:</strong></div>
<div><code>SELECT * FROM json_data LIMIT 10</code> - First 10 rows</div>
<div><code>SELECT name, email FROM json_data</code> - Specific columns</div>
<div><code>SELECT COUNT(*) FROM json_data</code> - Count rows</div>
<div style="margin-top: 8px;"><strong>Filtering:</strong></div>
<div><code>SELECT * FROM json_data WHERE salary > 90000</code> - Filter by salary</div>
<div><code>SELECT * FROM json_data WHERE department = 'Engineering'</code> - Filter by text</div>
<div><code>SELECT * FROM json_data WHERE name LIKE '%son'</code> - Pattern matching</div>
<div style="margin-top: 8px;"><strong>Aggregations:</strong></div>
<div><code>SELECT department, AVG(salary) FROM json_data GROUP BY department</code> - Average by group</div>
<div><code>SELECT department, COUNT(*) FROM json_data GROUP BY department</code> - Count by group</div>
<div style="margin-top: 8px;"><strong>Sorting:</strong></div>
<div><code>SELECT * FROM json_data ORDER BY salary DESC</code> - Sort descending</div>
<div><code>SELECT * FROM json_data ORDER BY name ASC</code> - Sort ascending</div>
<div id="joinExamples" style="display: none; margin-top: 8px;">
<div><strong>Joins (for hierarchical data):</strong></div>
<div><code id="joinExample1"></code></div>
<div><code id="joinExample2"></code></div>
</div>
</div>
</details>
</div>
</div>
<button class="btn-primary" onclick="executeSQLQuery()" title="Execute query (Ctrl+Enter)" style="height: auto; padding: 8px 12px;">Execute</button>
</div>
</div>
<!-- JSONPath Query Interface -->
<div id="jsonpathSection" class="query-mode-section hide">
<div style="display: flex; gap: 6px; margin-bottom: 8px; align-items: flex-start;">
<div style="flex: 1;">
<textarea id="jsonpathQuery" class="query-input" placeholder="$.users[?(@.salary > 90000)]"></textarea>
<div style="margin-top: 6px; font-size: 11px; color: var(--text-secondary);">
<details style="cursor: pointer;">
<summary style="user-select: none;">Examples & Help</summary>
<div style="margin-top: 8px; padding: 8px; background: var(--bg-tertiary); border-radius: 4px; line-height: 1.6;">
<div><code>$.users[*]</code> - All users</div>
<div><code>$..name</code> - All name properties (deep scan)</div>
<div><code>$.users[0]</code> - First user</div>
<div><code>$.users[-1]</code> - Last user</div>
<div><code>$.users[0:3]</code> - First 3 users</div>
<div><code>$.users[?(@.salary > 90000)]</code> - Filter by salary</div>
<div><code>$.users[?(@.department === 'Engineering')]</code> - Filter by department</div>
<div><code>$.users[*].name</code> - All user names</div>
</div>
</details>
</div>
</div>
<button class="btn-primary" onclick="executeJSONPathQuery()" title="Execute query (Ctrl+Enter)" style="height: auto; padding: 8px 12px;">Execute</button>
</div>
</div>
<!-- Query Error Display -->
<div id="queryError" class="hide" style="color: #ff4444; background: rgba(255, 68, 68, 0.1); padding: 8px 12px; margin-bottom: 8px; border-radius: 4px; font-size: 12px; border-left: 3px solid #ff4444;"></div>
<!-- Query Result Display -->
<div id="queryResult" class="query-result hide">
<div style="display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 8px; padding: 8px; background: var(--bg-tertiary); border-radius: 4px;">
<button class="btn-secondary" onclick="exportQueryToCSV()" title="Download query results as CSV file">📥 CSV</button>
<button class="btn-secondary" onclick="exportQueryToJSON()" title="Download query results as JSON file">📥 JSON</button>
<button class="btn-secondary" onclick="copyQueryAsJSON()" title="Copy query results JSON to clipboard">📋 Copy JSON</button>
<button class="btn-secondary" onclick="copyQueryAsMarkdown()" title="Copy query results Markdown table to clipboard">📋 Copy Markdown</button>
</div>
<div id="resultContent"></div>
</div>
</div>
</div>
</div>
<!-- SEO Content Section (Hidden but crawlable) -->
<section class="seo-content" style="position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;">
<h1>Free Online JSON, XML, and CSV Converter Tool</h1>
<p>QueryJSON is the best free online tool for converting, querying, and analyzing structured data. Whether you need a JSON viewer, XML to JSON converter, or CSV parser, QueryJSON handles it all in your browser without uploading data to any server.</p>
<h2>Key Features of QueryJSON</h2>
<ul>
<li><strong>JSON Viewer and Formatter:</strong> Parse, validate, and view JSON data in an interactive table format</li>
<li><strong>XML to JSON Converter:</strong> Automatically convert XML data to JSON with proper structure preservation</li>
<li><strong>CSV to JSON Converter:</strong> Transform CSV files into JSON format with automatic delimiter detection</li>
<li><strong>SQL Query Tool:</strong> Run PostgreSQL queries on your data using PGLite (PostgreSQL in the browser)</li>
<li><strong>JSONPath Query Support:</strong> Query nested JSON structures using JSONPath expressions</li>
<li><strong>Data Filtering:</strong> Apply multiple filters with various operators (equals, contains, greater than, etc.)</li>
<li><strong>Column Management:</strong> Select, reorder, and customize which columns to display</li>
<li><strong>Export & Copy:</strong> Download as CSV/JSON or copy as JSON/Markdown to clipboard</li>
<li><strong>100% Client-Side:</strong> All processing happens in your browser - no data sent to servers</li>
<li><strong>Free and Open Source:</strong> MIT licensed, completely free to use forever</li>
</ul>
<h2>How to Use QueryJSON</h2>
<ol>
<li>Paste or upload your JSON, XML, or CSV data</li>
<li>Click Parse to process your data</li>
<li>Select columns to display and apply filters as needed</li>
<li>Run SQL or JSONPath queries for advanced analysis</li>
<li>Export filtered results in your preferred format</li>
</ol>
<h2>Why Choose QueryJSON?</h2>
<p><strong>Privacy First:</strong> Unlike other online converters, QueryJSON processes all data entirely in your browser. Your sensitive data never leaves your computer, making it perfect for confidential information.</p>
<p><strong>No Sign-Up Required:</strong> Start using QueryJSON immediately without creating an account or providing any personal information.</p>
<p><strong>Developer Friendly:</strong> Built by developers for developers. Support for SQL queries, JSONPath, and multiple data formats makes it the perfect tool for data analysis and debugging.</p>
<p><strong>Fast and Efficient:</strong> Handle thousands of rows efficiently with our optimized data processing engine.</p>
<h2>Common Use Cases</h2>
<ul>
<li>Convert API responses from JSON to table format for easier reading</li>
<li>Transform XML data from legacy systems to JSON for modern applications</li>
<li>Parse and analyze CSV exports from databases or spreadsheets</li>
<li>Debug JSON data structures with the interactive viewer</li>
<li>Run SQL queries on JSON data without setting up a database</li>
<li>Filter and export specific data subsets from large datasets</li>
<li>Validate JSON syntax and structure</li>
<li>Convert between data formats for data migration projects</li>
</ul>
<h2>Supported Data Formats</h2>
<h3>JSON (JavaScript Object Notation)</h3>
<p>QueryJSON supports all valid JSON formats including nested objects, arrays, and complex data structures. Use our JSON viewer to visualize and query your data.</p>
<h3>XML (Extensible Markup Language)</h3>
<p>Convert XML to JSON automatically. Our parser handles XML attributes, nested elements, and converts them to a clean JSON structure.</p>
<h3>CSV (Comma-Separated Values)</h3>
<p>Import CSV files with automatic delimiter detection (comma, semicolon, or tab). The first row is treated as headers, and numeric values are automatically typed.</p>
<h2>Advanced Features</h2>
<h3>SQL Queries with PostgreSQL</h3>
<p>Run full PostgreSQL queries on your data using PGLite. Your data is loaded into a table called 'json_data' where you can perform SELECT, WHERE, JOIN, GROUP BY, and other SQL operations.</p>
<h3>JSONPath Queries</h3>
<p>Navigate complex JSON structures using JSONPath expressions. Perfect for extracting specific values from nested objects and arrays.</p>
<h3>Interactive Filtering</h3>
<p>Apply multiple filters simultaneously with operators including equals, not equals, contains, starts with, ends with, greater than, less than, is null, and is not null.</p>
<h2>Browser Compatibility</h2>
<p>QueryJSON works on all modern browsers including Chrome, Firefox, Safari, and Edge. JavaScript must be enabled for the application to function.</p>
<h2>Open Source and Free</h2>
<p>QueryJSON is open-source software released under the MIT License. You can view the source code, contribute improvements, or report issues on GitHub.</p>
<h2>Data Security and Privacy</h2>
<p>Your data security is our top priority. QueryJSON is a 100% client-side application that processes all data in your browser's memory. No data is uploaded to any server, stored in any database, or transmitted over the internet. When you close your browser tab, all data is completely removed.</p>
<h2>Performance</h2>
<p>QueryJSON can efficiently handle datasets with thousands of rows. Performance depends on your device's memory and processing power. For very large datasets (100,000+ rows), processing time may vary.</p>
<h2>Keywords</h2>
<p>json viewer, json formatter, json to table, json converter, json parser, json validator, json editor, online json tool, xml to json, xml converter, xml parser, csv to json, csv converter, csv parser, data converter, sql query tool, postgresql online, jsonpath query, free online tool, developer tools, data analysis</p>
</section>
<!-- Footer -->
<div class="footer">
<div class="footer-message">
Enjoying this tool? If you'd like to support future development and improvements, feel free to buy me a coffee. Every bit helps keep this project going!
</div>
<div class="footer-buttons">
<a href="https://www.buymeacoffee.com/dineshd" target="_blank">
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee">
</a>
</div>
<div style="margin-top: 8px; font-size: 11px; color: var(--text-secondary);">
<a href="https://github.com/dinesh-it/queryjson" target="_blank" style="color: var(--accent-primary); text-decoration: none;">View on GitHub</a>
|
<a href="https://github.com/dinesh-it/queryjson/issues" target="_blank" style="color: var(--accent-primary); text-decoration: none;">Report Issues</a>
|
<a href="mailto:support@queryjson.com" style="color: var(--accent-primary); text-decoration: none;">Give Feedback</a>
|
<a href="docs/ROADMAP.md" target="_blank" style="color: var(--accent-primary); text-decoration: none;">Roadmap</a>
|
<a href="LICENSE" target="_blank" style="color: var(--accent-primary); text-decoration: none;">MIT License</a>
</div>
</div>
</div>
<!-- Loading Overlay -->
<div id="loadingOverlay" class="loading-overlay">
<div class="loading-content">
<div class="loading-spinner">⚙</div>
<div class="loading-text">Processing...</div>
</div>
</div>
<!-- Help Modal -->
<div id="helpModal" class="modal">
<div class="modal-content">
<span class="modal-close" onclick="closeHelpModal()">×</span>
<h2>About - QueryJSON</h2>
<div class="modal-body">
<h3>About QueryJSON</h3>
<p>QueryJSON is a powerful web-based tool that allows you to transform, query, and explore structured data in multiple formats. Convert JSON, XML, and CSV data into interactive tables, apply filters, and run SQL or JSONPath queries - all in your browser with no server required.</p>
<h3>Key Features</h3>
<ul>
<li><strong>Multi-Format Support:</strong> Import data in JSON, XML, or CSV format</li>
<li><strong>Interactive Table View:</strong> View your data in a sortable, filterable table</li>
<li><strong>SQL Queries:</strong> Run PostgreSQL queries using PGLite (PostgreSQL in the browser)</li>
<li><strong>JSONPath Queries:</strong> Query JSON data using JSONPath expressions</li>
<li><strong>Column Management:</strong> Select, reorder, and customize which columns to display</li>
<li><strong>Advanced Filtering:</strong> Apply multiple filters with various operators</li>
<li><strong>Export & Copy:</strong> Download as CSV/JSON or copy as JSON/Markdown to clipboard</li>
<li><strong>Privacy First:</strong> All processing happens in your browser - no data is sent to any server</li>
</ul>
<h3>How to Use</h3>
<ol>
<li><strong>Input Data:</strong> Paste or upload your JSON, XML, or CSV data in the INPUT section</li>
<li><strong>Parse:</strong> Click the "Parse" button to process your data</li>
<li><strong>Choose Columns:</strong> Select which columns to display and reorder them by dragging</li>
<li><strong>Filter:</strong> Add filters to narrow down your data using various operators</li>
<li><strong>View Output:</strong> See your data in an interactive table with search and sort capabilities</li>
<li><strong>Query:</strong> Use SQL or JSONPath to run advanced queries on your data</li>
<li><strong>Export:</strong> Download your filtered results as CSV or JSON</li>
</ol>
<h3>Keyboard Shortcuts</h3>
<ul>
<li><strong>Ctrl/Cmd + Enter:</strong> Execute SQL or JSONPath query</li>
</ul>
<h3>Tips</h3>
<ul>
<li>The tool automatically detects your data format (JSON, XML, or CSV)</li>
<li>For CSV, the first row is treated as headers</li>
<li>XML and CSV data are automatically converted to JSON for processing</li>
<li>Use the search box to quickly find data across all visible columns</li>
<li>Click column headers to sort the table</li>
<li>Drag column items to reorder them</li>
</ul>
</div>
</div>
</div>
<!-- FAQ Modal -->
<div id="faqModal" class="modal">
<div class="modal-content">
<span class="modal-close" onclick="closeFAQModal()">×</span>
<h2>Frequently Asked Questions</h2>
<div class="modal-body">
<div class="faq-item">
<h3>What data formats are supported?</h3>
<p>QueryJSON supports JSON, XML, and CSV formats. The tool automatically detects the format when you paste or upload data.</p>
</div>
<div class="faq-item">
<h3>Is my data secure? Is it sent to a server?</h3>
<p>Your data is completely secure. All processing happens entirely in your browser using client-side JavaScript. No data is ever sent to any server or stored anywhere except your browser's memory.</p>
</div>
<div class="faq-item">
<h3>What's the difference between SQL and JSONPath queries?</h3>
<p><strong>SQL:</strong> Runs PostgreSQL queries on your data using PGLite. Best for aggregations, joins, and complex filtering. Your data is loaded into a table called <code>json_data</code>.</p>
<p><strong>JSONPath:</strong> Queries the original JSON structure using path expressions. Best for navigating nested JSON and extracting specific values.</p>
</div>
<div class="faq-item">
<h3>How do I query my data with SQL?</h3>
<p>After parsing your data, switch to the SQL tab in the QUERY section. Your data is available in a table called <code>json_data</code>. For example: <code>SELECT * FROM json_data WHERE salary > 90000</code></p>
</div>
<div class="faq-item">
<h3>Can I use this tool offline?</h3>
<p>The tool requires an internet connection to load the external libraries (PGLite, JSONPath) on first load. However, once loaded, it can work offline for the duration of your session.</p>
</div>
<div class="faq-item">
<h3>What happens when I parse XML or CSV?</h3>
<p>XML and CSV data are automatically converted to JSON format. The converted JSON is displayed in the input textarea so you can see the structure. The data then follows the normal processing flow.</p>
</div>
<div class="faq-item">
<h3>How do filters work?</h3>
<p>You can add multiple filters with different operators (equals, contains, greater than, etc.). All filters are applied with AND logic - data must match all filters to be displayed.</p>
</div>
<div class="faq-item">
<h3>What's the maximum data size I can process?</h3>
<p>Since everything runs in your browser, the limit depends on your device's memory. The tool can handle thousands of rows efficiently. For very large datasets (100k+ rows), performance may vary based on your device.</p>
</div>
<div class="faq-item">
<h3>Can I save my queries?</h3>
<p>Currently, queries are not saved automatically. You can copy your queries and save them externally. We may add query saving in future updates.</p>
</div>
<div class="faq-item">
<h3>How do I report a bug or request a feature?</h3>
<p>Visit our <a href="https://github.com/dinesh-it/queryjson" target="_blank">GitHub repository</a> to report issues or request features.</p>
</div>
<div class="faq-item">
<h3>Is this tool free?</h3>
<p>Yes! QueryJSON is completely free and open-source under the MIT License. If you find it useful, consider supporting the project on <a href="https://www.buymeacoffee.com/dineshd" target="_blank">Buy Me A Coffee</a>.</p>
</div>
</div>
</div>
</div>
<!-- Scripts -->
<script src="static/js/app.min.js?v=db150680"></script>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js').then(registration => {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, err => {
console.log('ServiceWorker registration failed: ', err);
});
});
}
</script>
</body>
</html>