← Retour au Blog

Comment ouvrir les fichiers JSON : Guide complet multiplateforme

Apprenez à ouvrir et lire les fichiers JSON sur Windows, Mac, Linux. Guide avec éditeurs, navigateurs, ligne de commande et programmation.

Big JSON Team10 min de lecturebeginner
B

Big JSON Team

Technical Writer

Expert in JSON data manipulation, API development, and web technologies. Passionate about creating tools that make developers' lives easier.

10 min de lecture

# Comment ouvrir les fichiers JSON : Guide complet multiplateforme

Les fichiers JSON peuvent être ouverts de nombreuses façons. Ce guide vous montre toutes les méthodes pour visualiser et éditer vos fichiers JSON.

Ouvrir JSON dans un navigateur

Méthode drag & drop

  • Ouvrez votre navigateur (Chrome, Firefox, Safari, Edge)
  • Glissez-déposez le fichier .json dans la fenêtre
  • Le JSON s'affiche formaté
  • Extensions recommandées :
    • Chrome : JSON Viewer
    • Firefox : JSONView
    • Edge : JSON Formatter

    Éditeurs de texte

    Visual Studio Code (Recommandé)

    Avantages :
    • Coloration syntaxique
    • Validation automatique
    • Formatage (Shift+Alt+F)
    • IntelliSense
    • Gratuit

    Ouvrir un fichier :

    \\\bash

    code fichier.json

    \\\

    Notepad++ (Windows)

    Gratuit, léger, support JSON natif.

    Sublime Text

    Rapide, puissant, multi-plateforme.

    Atom

    Gratuit, extensible, moderne.

    Éditeurs JSON spécialisés

    JSON Editor Online

    • URL : jsoneditoronline.org
    • Vue arbre + code
    • Gratuit

    JSONLint

    • URL : jsonlint.com
    • Validation + formatage

    Code Beautify

    • URL : codebeautify.org/jsonviewer
    • Multi-outils

    Ligne de commande

    Windows PowerShell

    \\\powershell

    # Afficher contenu

    Get-Content fichier.json

    # Avec formatage

    Get-Content fichier.json | ConvertFrom-Json | ConvertTo-Json

    # Parser et explorer

    $json = Get-Content fichier.json | ConvertFrom-Json

    $json.users

    \\\

    Linux/Mac Terminal

    \\\bash

    # Afficher contenu

    cat fichier.json

    # Avec jq (formateur)

    jq . fichier.json

    # Filtrer données

    jq '.users[] | select(.age > 30)' fichier.json

    \\\

    Installation jq

    \\\bash

    # Mac

    brew install jq

    # Ubuntu/Debian

    sudo apt-get install jq

    # Windows (Chocolatey)

    choco install jq

    \\\

    Ouvrir avec Python

    \\\python

    import json

    # Lire et afficher

    with open('fichier.json', 'r', encoding='utf-8') as f:

    data = json.load(f)

    print(json.dumps(data, indent=2, ensure_ascii=False))

    \\\

    Ouvrir avec JavaScript/Node.js

    \\\javascript

    const fs = require('fs');

    // Lire fichier

    const data = JSON.parse(fs.readFileSync('fichier.json', 'utf8'));

    console.log(JSON.stringify(data, null, 2));

    \\\

    Problèmes courants

    Fichier trop grand

    Solutions :
    • Éditeurs légers (Sublime, Vim)
    • Ligne de commande (jq)
    • Stream processing

    Erreur d'encodage

    Solution :

    \\\python

    # Spécifier UTF-8

    with open('fichier.json', 'r', encoding='utf-8') as f:

    data = json.load(f)

    \\\

    JSON invalide

    Validation :

    \\\bash

    # Avec jq

    jq . fichier.json

    # Avec Python

    python -m json.tool fichier.json

    \\\

    Applications Desktop

    JSON Viewer (Windows)

    • Gratuit
    • Visionneuse arbre
    • Recherche rapide

    Pretty JSON (Mac)

    • Interface native
    • Formatage automatique

    Dans Excel

  • Importer données → À partir du Web/Fichier
  • Sélectionner fichier .json
  • Transformer en tableau
  • Charger
  • Meilleures pratiques

  • Utiliser VS Code pour édition quotidienne
  • jq pour terminal pour traitement par lots
  • Navigateur pour visualisation rapide
  • Outils en ligne pour accès sans installation
  • Conclusion

    Recommandations par usage :
    • Développement : VS Code
    • Visualisation : Navigateur + extension
    • Terminal : jq
    • Analyse : Python/Excel

    Choisissez l'outil adapté à vos besoins !

    Share:

    Articles Connexes

    Read in English