# How to copy a PROMPT from ChatGPT with formatting preserved after a response is generated?

When I have a really good prompt in ChatGPT that did what I wanted it to do. In particular, when it was something data-wrangling related. For example, when I supplied the prompt with JSON or HTML, or some leading spaces, and new lines.

By default, after ChatGPT generates the response, and you try to copy-paste the prompt to a text editor, it'll be pasted as one long line of text. For example, the prompt from this chat session:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1756993366123/615686ab-f10d-4a4f-9058-64104cfed8b2.png align="center")

gets pasted to Notepad as:  

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1756993439375/1c77cf6f-5188-4f46-8878-0a7322c14249.png align="center")

  
To preserve formatting from the prompt, you can open [Developer Tools](https://learn.microsoft.com/en-us/microsoft-edge/devtools/overview) in your browser (F12 shortcut on my machine, or Right Click, and select “Inspect”), focus on the prompt HTML element, and either double click on it, or Right Click + “Edit as HTML”, then copy text, and paste it in your text editor of choice:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1756993905024/f5d902fd-3bad-4c3f-9c0b-04fe9d6caf8a.gif align="center")

Now your prompt is going to be pasted as:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1756993940331/6e413f38-bf0e-4902-925e-93a22ae01f3a.png align="center")

Hope this helps. Please let me know in the comments if you have any questions.
