Prompt Like a Pro w/JSON & XML

How to get the perfect output every time.

Ever written out a big beautiful prompt only to get back a disappointing (if not downright awful) response? Frustrating, isn’t it?

If you’ve ever been baffled by an AI’s reply, you’re not alone.

The key most people overlook is this: Despite being user-friendly, LLMs operate based on code - not plain English. And because of that, there are situations where structuring your prompts using code can help you generate dramatically better results.

So today, we’ll dive into the three most common prompt formats—plain text, JSON, and XML—and explore when you should use each to get the absolute best response.

Why Format Matters

Imagine you’re talking to a friend and you ask them to tell you what happened in response to something they just said. In that moment, they will instantly and subconsciously analyze:

  • Your interest in the topic

  • How much time you have left to spend together

  • Your preferred storytelling / communication style

  • How you responded to their stories in the past

…and so on before they reply to you. And they’ll do so in an instant.

But when you ask AI?

Not so much.

That’s because LLMs thrive on specifics.

And the structure of your prompt acts like a roadmap, telling the AI, “Here’s what I want, and here’s how I want you to deliver what I just asked you for.”

In some cases, it’s possible to do this using plain English (or your language or choice). But in many cases, structuring your request in the language of artificial intelligence can help you get a dramatically higher quality response (on the very first attempt).

Which is why power users understand when to use code prompts, and when it’s OK to prompt in plain text.

Plain Text vs. JSON vs. XML

Let’s explore the three main “dialects” for communicating with AI, breaking down where each shines and where each falls short.

A. Plain Text

The most natural, freeform way to talk to AI. For 99% of you, this is how you prompt.

Pros:

  • Quick and easy for everyday questions

  • Perfect for creative brainstorming or open-ended ideas

  • No learning curve—just type and go

Cons:

  • Can be vague (“Give me ideas” could lead anywhere)

  • Hard to enforce structure—answers might jump between formats

  • Inconsistent output—one time you get bullets, another time paragraphs

Best For:

  • Quick questions and answers

  • Open-ended brainstorming

  • Short summaries or explanations

Example: Can you suggest a four-day itinerary for Rome with food, history, and a little time to relax?

With a prompt like this you’ll likely get a fun, casual response, but it might not be the structured day-by-day plan you hoped for.

B. JSON

Structured like a digital checklist, JSON is a labeled data formatting the AI can’t misinterpret. This is a good thing if you’re looking for a highly structured output (e.g. a long-form blog article that follows a highly specific template) but is less useful (and potentially restricting) for more open-ended, creative prompts.

What It Is:
A clean, labeled format, like a spreadsheet or form, where every piece of information has a clear tag.

Pros:

  • Crystal clear—every piece of info is labeled, leaving no room for confusion

  • Delivers consistent, reliable answers

  • Perfect for turning responses into usable data for lists, catalogs, or spreadsheets

Cons:

  • Less conversational and slightly technical to write

  • Rigid—don’t expect creative flair

  • Requires knowing what “keys” (categories) to ask for

Best For:

  • Product lists or comparisons

  • Data extraction (e.g., “Give me 10 ideas in this format…”)

  • Results you want to copy into spreadsheets or databases

Example:

On the surface, this looks like a regular text prompt with some weird formatting. But from the LLM’s point of view, this reads like an entirely different set of instructions relative to plain text.

Specifically, it’s dramatically more rigid (which as discussed above, may or may not be what you’re looking for).

So how do you get this kind of prompt if you don’t know how to code?

To get a JSON prompt, add this before your regular text prompt:

Your job is to take the below text AI prompt and convert it into JSON (so that when submitted to an AI text/video/image generator, the AI can more easily, efficiently and effectively interpret the purpose of the prompt). Consider the “keys” most relevant to JSON and the nature of the prompt itself.

*If you find this reduces your original text prompt too dramatically, you can add this line to it: Do not add or delete any words, just structure the text you are given using JSON.

C. XML

If plain text is the crazy art teacher of prompting, and JSON is the super boring chemistry professor, XML prompts fall somewhere in the middle.

Similar to the HTML code many websites are built on, XML leverages markup that’s focused on opening and closing “tags” (like <title> or <section>) to create a clear hierarchy.

And that hierarchy is perfect for nesting information without forcing too rigid of a response (like you might get with JSON).

Pros:

  • Ideal for complex, nested data with sections or subcategories

  • Great for customizable templates, like documents or sales letters

  • Lets you create meaningful tags to describe exactly what you want

Cons:

  • Verbose—lots of tags can make it bulky

  • Overkill for simple lists or one-off tasks

  • Might feel unfamiliar if you haven’t worked with HTML-like structures

Best For:

  • Complex outlines (e.g., blog posts, books, menus)

  • Document templates (e.g., contracts, proposals)

  • Anything where hierarchy and structure matter

Example:

As you can see here, an XML prompt looks much more similar to a text one than a JSON one. And that’s because it is - it just takes plain text and formats it using an LLM friendly structure your AI of choice will understand.

To convert a text prompt into an XML one, add this before your request:

Your job is to take the plain text AI prompt below and convert it into XML (so that the AI being used to request an output can better understand the essence of the prompt). The user will submit their prompt to you verbatim, and you will transform it into XML. Feel free to add and remove high level structure as you see fit to increase the LLM's comprehension of the prompt based on your understanding of AI prompting.

It should be noted that you can convert attachments into both JSON and XML and vice versa. As an example, I use both at a Developer/System prompt level (with automations and Poe bots), and I also upload both with text prompts where relevant.

Notice the use of a text prompt that contains JSON & XML attachments.

In fact, compared to submitting plain text PDFs and relying on text prompts, combining all three can help you generate dramatically better outputs.

So when should you use each one?

When to Use Which Format

Choosing the right format is simpler than it sounds. Think of it like picking a communication style: a voice memo, a checklist, or a blueprint.

  • Plain Text: Like leaving a quick voice note for a friend. Loose, fast, and flexible.

  • JSON: Like using a checklist app. Every item is labeled, no details get lost.

  • XML: Like handing over a blueprint. Structure and hierarchy are everything.

Quick Decision Cheatsheet:

  • Need creativity or open-ended answers? → Use plain text.

  • Need structured data you can skim, share, or analyze? → Use JSON.

  • Need templates, outlines, or complex hierarchy? → Use XML.

Format = Outcome

In conclusion, while you and I speak human language, LLMs like ChatGPT speak computer code. And because of that, communicating with your AI of choice in its preferred language can (in many cases) deliver much better results.

So the next time you interact with an AI, pick a format that matches your goal and don’t be afraid to experiment. Sure, you might burn through some of your tokens.

But with the ability to generate dramatically better outputs, this is a skill worth learning.

And if you’re interested in learning more advanced AI techniques, including how to build automations and how to replace paid software with free/low cost vibe coding alternatives, make sure to join Sentient’s brand-new members community (it’s free : )

Catch you next time,

Louis & Ivan

ChatGPTricks Post of the Week:

What did you think?

Did you enjoy this newsletter blast?

Login or Subscribe to participate in polls.

Want to connect with us? Send us a DM!