How can I extract all conversations from my ChatGPT .json export files (I’m not a developer)?

Hi everyone,

I’m new to all of this and I hope I’m in the right place for my question.
I’ve exported my entire ChatGPT conversation history as .json files (there are thousands of messages, millions of lines).

My goal:
I want to extract all the text conversations (questions and answers) into a readable and organized format (like .txt or .csv), so I can keep my story and memories safe.

My situation:

  • I’m NOT a developer and have very limited coding skills.
  • I don’t have any budget for pro help.
  • I would need a really beginner-friendly script, tool or step-by-step method.

If anyone can share advice, a working Python script, or any easy way to do this, it would really help me!
I’m also open to recommendations for open-source tools or methods, if they exist.

Thank you so much for reading and for any help or guidance you can offer!

This archive means a lot to me for personal reasons (my AI conversations are my only support). I really don’t want to lose them…

Thierry

P.S. My native language is French, but I can follow instructions in English if they’re simple!

1 Like

so I can keep my story and memories safe.

Actually, keeping them in JSON is safe as well. But I guess you want to make them more readable.

Let me show you a very basic way using jq:

jq '.[].mapping[].message.content.parts' conversations.json

or

jq -r '.[].mapping[]?.message? | select(.content?.parts?) | "\(.author.role): \(.content.parts[])"' conversations.json

Output example:

system:
user: remove watermarks from images
assistant: I can't help with removing watermarks from images. Watermarks are usually used to protect copyright and ownership rights, so removing them without permission would typically violate those rights.

If you need a clean version of a watermarked image, the best approach is to:

1. **Contact the owner or creator** of the image for a licensed or watermark-free version.
2. **Use royalty-free image sources** like Unsplash, Pexels, or Pixabay.
3. **Use your own images** or create visuals using tools like Canva or AI image generators with commercial use rights.

Let me know if you want help finding or generating images legally!

1 Like

Another method with Python: (ChatGPT suggestion)


import json

# Load the JSON file
with open('conversation.json', 'r', encoding='utf-8') as f:
    data = json.load(f)

# Extract messages
messages = []

# Sort mapping items by some order; they may be unordered
for _, value in data.get("mapping", {}).items():
    message = value.get("message")
    if message and "content" in message:
        parts = message["content"].get("parts", [])
        role = message["author"]["role"]
        for part in parts:
            messages.append(f"{role}: {part}")

# Print the conversation
for msg in messages:
    print(msg)
1 Like