MySQL to Firebase Converter
Transform MySQL database dumps into Firebase Realtime Database format
MySQL Input
Convert MySQL to other formats
Firebase JSON Output
Related Tools
MySQL to HTML
Convert MySQL CREATE TABLE and INSERT statements to HTML table with styling options
MySQL to INI
Convert MySQL CREATE TABLE and INSERT statements to INI configuration file format
MySQL to Jira
Convert MySQL CREATE TABLE and INSERT statements to Jira table markup format
MySQL to JPEG
Convert MySQL database dumps to JPEG image with customizable styling
MySQL to JSON
Convert MySQL CREATE TABLE and INSERT statements to JSON arrays and objects
MySQL to JSON Lines
Convert MySQL CREATE TABLE and INSERT statements to JSON Lines (JSONL) format
About MySQL to Firebase Converter
Convert MySQL database dumps (CREATE TABLE and INSERT statements) to Firebase Realtime Database JSON structure. Perfect for migrating MySQL data to Firebase or creating test data for Firebase applications.
Key Features
- Automatic Parsing: Extracts table structure and data from MySQL dumps
- Type Conversion: Converts MySQL data types to appropriate JSON types (numbers, booleans, strings, null)
- Flexible Keys: Choose between auto-generated keys or use a specific column as the key
- Firebase Compatible: Generates JSON structure ready for Firebase import
- Key Sanitization: Removes Firebase-restricted characters (., #, $, [, ]) from keys
- File Upload: Upload .sql files directly
How to Use
- Input MySQL Data: Paste your MySQL CREATE TABLE and INSERT statements or upload a .sql file
- Configure Keys: Choose auto-generated keys or specify a column to use as Firebase keys
- Review Output: The Firebase JSON generates automatically
- Copy or Download: Use the Copy or Download button to save your Firebase data
Key Options
- Auto-Generated Keys: Creates keys like item_0, item_1, item_2... (default)
- Custom Key Field: Use a specific column (e.g., "id") as the Firebase key
Example Conversion
MySQL Input:
CREATE TABLE employees ( id INT PRIMARY KEY, name VARCHAR(100), age INT, salary DECIMAL(10,2) ); INSERT INTO employees VALUES (1, 'John Doe', 28, 75000.00); INSERT INTO employees VALUES (2, 'Jane Smith', 34, 82000.50);
Firebase JSON Output (Auto Keys):
{
"item_0": {
"id": 1,
"name": "John Doe",
"age": 28,
"salary": 75000
},
"item_1": {
"id": 2,
"name": "Jane Smith",
"age": 34,
"salary": 82000.5
}
} Firebase JSON Output (Using 'id' as key):
{
"1": {
"id": 1,
"name": "John Doe",
"age": 28,
"salary": 75000
},
"2": {
"id": 2,
"name": "Jane Smith",
"age": 34,
"salary": 82000.5
}
} Type Conversion
- Numbers: INT, BIGINT, DECIMAL, FLOAT, DOUBLE → JSON numbers
- Booleans: BOOLEAN, true/false → JSON booleans
- Strings: VARCHAR, CHAR, TEXT → JSON strings
- NULL: NULL or empty values → JSON null
Firebase Key Restrictions
Firebase keys cannot contain certain characters. This tool automatically sanitizes keys by replacing the following characters with underscores:
- . (period)
- # (hash)
- $ (dollar sign)
- [ (left bracket)
- ] (right bracket)
Common Use Cases
- Database Migration: Migrate MySQL data to Firebase Realtime Database
- Test Data: Create Firebase test data from MySQL dumps
- Prototyping: Quickly populate Firebase with existing MySQL data
- Data Backup: Export MySQL data in Firebase-compatible format
- Cross-Platform: Share data between MySQL and Firebase applications
- Development: Seed Firebase development databases from MySQL
Importing to Firebase
To import the generated JSON to Firebase Realtime Database:
- Open Firebase Console
- Navigate to Realtime Database
- Click the three-dot menu (⋮) and select "Import JSON"
- Upload the downloaded JSON file
FAQ
- Is this JSON for Realtime Database or Firestore?
The structure is tailored for Firebase Realtime Database. Firestore uses a different data model, so you would need to adapt the JSON if you want to import into Firestore.
- What happens if my key field contains invalid characters?
Firebase keys cannot contain
.,#,$,[, or]. The tool automatically replaces these characters with underscores when building keys. - Can I nest the generated JSON under a path?
Yes. You can wrap the exported object inside another JSON object or import it at a specific node in the Realtime Database tree.
- How are numbers and booleans handled?
The converter inspects each value and outputs JSON numbers or booleans where appropriate, so Firebase will store them with the correct types.
- Does the tool upload anything to Firebase automatically?
No. It only generates JSON locally. You control when and where to import the file using the Firebase Console or your own scripts.
Privacy & Security
All conversions happen locally in your browser. Your MySQL data is never uploaded to any server, ensuring complete privacy and security.
