Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ public/*
!public/apple-touch-icon.png
!public/ads/
!ads.txt
!public/robots.txt
!public/sitemap.xml
# Local-only backups of source mockups — don't track in git
public/ads/_originals/
8 changes: 7 additions & 1 deletion public/privacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Privacy Policy - Python Dict to JSON Converter</title>
<meta name="description" content="Privacy policy for dict2json.com, the Python dictionary to JSON converter.">
<meta name="description" content="Privacy policy for dict2json.com. Learn what information we collect, how analytics work, our cookie use, and your rights as a visitor.">
<meta name="robots" content="index,follow">
<link rel="canonical" href="https://dict2json.com/privacy">
<meta property="og:type" content="article">
<meta property="og:title" content="Privacy Policy - dict2json">
<meta property="og:description" content="How dict2json.com handles visitor information, analytics, and cookies.">
<meta property="og:url" content="https://dict2json.com/privacy">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<style>
:root {
Expand Down
4 changes: 4 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Allow: /

Sitemap: https://dict2json.com/sitemap.xml
13 changes: 13 additions & 0 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://dict2json.com/</loc>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://dict2json.com/privacy</loc>
<changefreq>yearly</changefreq>
<priority>0.3</priority>
</url>
</urlset>
2 changes: 0 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ function App() {

return (
<div className={`app ${isFullScreen ? 'full-screen' : ''}`}>
<h1>Python Dict to JSON Converter</h1>
<p className="subheading">Paste your Python dictionary to convert it to valid JSON format instantly</p>
<Toast show={showToast} />
<TshirtAds />

Expand Down
112 changes: 104 additions & 8 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,115 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Python Dict to JSON Converter Online</title>
<meta name="description" content="Convert Python dictionaries to JSON format online. Paste your Python dict and get the equivalent JSON output instantly.">
<title>Python Dict to JSON Converter Online | dict2json</title>
<meta name="description" content="Free online converter for Python dictionaries to JSON. Paste a Python dict and instantly get valid JSON — handles True/False, None, single quotes, and nested structures in your browser.">
<link rel="canonical" href="https://dict2json.com/">
<meta name="theme-color" content="#2d3748">

<meta property="og:type" content="website">
<meta property="og:site_name" content="dict2json">
<meta property="og:title" content="Python Dict to JSON Converter Online">
<meta property="og:description" content="Paste a Python dictionary, get valid JSON instantly. Handles True/False, None, and single quotes. Runs entirely in your browser.">
<meta property="og:url" content="https://dict2json.com/">
<meta property="og:image" content="https://dict2json.com/ads/horizontal.jpg">
<meta property="og:locale" content="en_US">

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Python Dict to JSON Converter Online">
<meta name="twitter:description" content="Paste a Python dictionary, get valid JSON instantly. Runs entirely in your browser.">
<meta name="twitter:image" content="https://dict2json.com/ads/horizontal.jpg">

<link rel="preconnect" href="https://www.googletagmanager.com">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<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="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="shortcut icon" href="/favicon.ico">

<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebApplication",
"@id": "https://dict2json.com/#app",
"name": "Python Dict to JSON Converter",
"url": "https://dict2json.com/",
"description": "Online tool that converts Python dictionaries to JSON format. Translates True/False to true/false, None to null, and single quotes to double quotes.",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Any",
"browserRequirements": "Requires JavaScript",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"featureList": [
"Convert Python dict to JSON",
"Handles nested dictionaries",
"Converts True/False/None to JSON equivalents",
"Converts single quotes to double quotes",
"Runs entirely in the browser — data never leaves your device"
]
},
{
"@type": "FAQPage",
"@id": "https://dict2json.com/#faq",
"mainEntity": [
{
"@type": "Question",
"name": "What is a Python dictionary?",
"acceptedAnswer": {
"@type": "Answer",
"text": "A Python dictionary is a built-in data structure that stores key-value pairs. Keys must be unique and immutable; values can be any type, including other dictionaries. Dictionaries are mutable and preserve insertion order in Python 3.7+."
}
},
{
"@type": "Question",
"name": "What is JSON?",
"acceptedAnswer": {
"@type": "Answer",
"text": "JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format. It is language-independent, supports strings, numbers, booleans, null, arrays, and objects, and uses double quotes for strings and property names."
}
},
{
"@type": "Question",
"name": "How is Python dict syntax different from JSON?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Python uses True, False, and None where JSON uses true, false, and null. Python allows single or double quotes; JSON requires double quotes only. JSON does not support comments or trailing commas."
}
},
{
"@type": "Question",
"name": "Is my data sent to a server?",
"acceptedAnswer": {
"@type": "Answer",
"text": "No. All conversion happens in your browser. The Python dictionary you paste never leaves your device."
}
},
{
"@type": "Question",
"name": "Does the converter support nested dictionaries?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes. Nested dictionaries, lists, and mixed structures are converted recursively to valid JSON."
}
}
]
}
]
}
</script>
</head>
<body>
<h1>Python Dict to JSON Converter</h1>
<p class="subheading">Paste your Python dictionary to convert it to valid JSON format instantly</p>

<div id="root"></div>

<main class="content-section">
<section class="recommended-reading">
<section class="recommended-reading" id="recommended-reading">
<h2>Recommended Reading</h2>
<p class="affiliate-note">The links below are Amazon affiliate links. If you purchase through them, we may earn a small commission at no extra cost to you.</p>
<ul>
Expand All @@ -25,9 +121,9 @@ <h2>Recommended Reading</h2>
</ul>
</section>

<h2>About Python Dictionaries and JSON</h2>
<h2 id="about">About Python Dictionaries and JSON</h2>

<section>
<section id="what-is-a-python-dictionary">
<h3>What is a Python Dictionary?</h3>
<p>A Python dictionary is a built-in data structure that stores key-value pairs. It's one of Python's most useful and widely-used data types, allowing you to create mappings between related pieces of information. Dictionaries are defined using curly braces <code>{}</code> with key-value pairs separated by commas.</p>
<h4>Key Features of Python Dictionaries:</h4>
Expand All @@ -40,7 +136,7 @@ <h4>Key Features of Python Dictionaries:</h4>
<p>Learn more about Python dictionaries in the <a href="https://docs.python.org/3/tutorial/datastructures.html#dictionaries" target="_blank" rel="noopener">official Python documentation</a>.</p>
</section>

<section>
<section id="what-is-json">
<h3>What is JSON?</h3>
<p>JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format that's easy for humans to read and write and easy for machines to parse and generate. It's language-independent and has become one of the most popular data formats for web APIs and configuration files.</p>
<h4>Key Features of JSON:</h4>
Expand All @@ -53,7 +149,7 @@ <h4>Key Features of JSON:</h4>
<p>Learn more about JSON at <a href="https://www.json.org/" target="_blank" rel="noopener">json.org</a>.</p>
</section>

<section>
<section id="dict-vs-json">
<h3>Converting Between Python Dictionaries and JSON</h3>
<p>While Python dictionaries and JSON objects are similar, there are some key differences in syntax and data types:</p>
<table>
Expand All @@ -69,7 +165,7 @@ <h3>Converting Between Python Dictionaries and JSON</h3>
<p>Our converter handles these differences automatically, ensuring your Python dictionary is properly converted to valid JSON format.</p>
</section>

<section>
<section id="use-cases">
<h3>Common Use Cases</h3>
<ul>
<li>Converting configuration files between Python and JSON formats</li>
Expand Down
7 changes: 6 additions & 1 deletion src/styles/layout.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
body {
margin: 0;
font-family: var(--font-family);
}

.app {
max-width: 80%;
margin: 0 auto;
Expand Down Expand Up @@ -51,7 +56,7 @@

h1 {
text-align: center;
margin: 0 0 8px;
margin: 20px 0 8px;
color: var(--tooltip-bg);
font-size: 28px;
font-weight: 600;
Expand Down
Loading