Prompt Formatter

Format your prompts with proper structure for system, user, and assistant messages. Improve prompt organization.

XML Format

<system>
You are a helpful assistant that provides clear and concise answers.
</system>

<user>
Hello! Can you help me with something?
</user>

JSON Format

[
  {
    "role": "system",
    "content": "You are a helpful assistant that provides clear and concise answers."
  },
  {
    "role": "user",
    "content": "Hello! Can you help me with something?"
  }
]

Message Roles

System:

Sets the behavior and context for the AI. Use this to define the AI's personality, constraints, and overall approach.

User:

The input or question from the user. This is what you want the AI to respond to.

Assistant:

The AI's response. Include this for few-shot prompting or to continue a conversation.

Best Practices

  • Start with a clear system message to set expectations
  • Use specific, detailed instructions
  • Include examples for complex tasks
  • Break down multi-step tasks into clear steps
  • Test and iterate on your prompts

Frequently Asked Questions

What is the system message for?

The system message sets the overall behavior and context for the AI. It's used to define the AI's role, personality, constraints, and any special instructions that should apply to the entire conversation. A good system message helps the AI understand how to approach all subsequent user messages.

When should I include assistant messages?

Include assistant messages when you want to provide examples of desired responses (few-shot prompting) or when continuing an existing conversation. This helps the AI understand the format and style you're looking for in its responses.

Which output format should I use?

Use the XML format for general readability and when sharing prompts with others. Use the JSON format when integrating with APIs or when you need a structured data format. Both represent the same information in different ways.

How do I write effective system messages?

Effective system messages are clear, specific, and concise. Define the AI's role explicitly, set any constraints or rules, and provide context about the task. Avoid ambiguity and test different variations to see what works best for your use case.