P2P Code Share

Connects to a serviceSecurity#P2P#Code

Edit code together in real time over an encrypted peer-to-peer link. Runs JavaScript in a sandbox.

Not shared. You can edit and run code on your own.

Run executes JavaScript in an isolated sandbox in your browser: it can't read this site's data, and it stops after 5 seconds. Only you see the output unless you share it.

Output
Click Run to see console output here.
How to use, limits & privacy

About P2P Code Share

Edit code together with one other person in real time, straight from your browsers. Changes from both sides are merged as you type, the language and syntax highlighting stay in sync, and an optional video call lets you talk it through. JavaScript can be run in an isolated sandbox in your own browser; other languages are highlighted only. It suits pair programming, quick code reviews, interview practice and helping a friend debug.

How to Use

1

Start a session

Click Start session. The tool creates a private link with a random 12-character code.

2

Share the link

Copy the link or show the QR code, and open it on the other device. Keep both tabs open for the whole session.

3

Check the safety code

Once connected, both screens show the same 6-digit safety code. If the codes differ, click Leave.

4

Edit, run and talk

Type together, pick the language, click Run (or press Ctrl+Enter) for JavaScript, and click Share output if you want the other person to see the result. Start video turns on your camera and microphone only when you click it.

Privacy & Processing

  • Mode: connected
  • Files Leave Browser: Selected data may be sent to a service or peer
  • Max Input Size: API dependent
  • Account Required: No
  • Data Stored Locally: Nothing is saved; the code stays in this tab until you close it.
  • Network Processing: Required for connected features

Code, output and video travel directly between the two browsers over encrypted WebRTC. The public PeerJS server (0.peerjs.com) introduces them and sees the room code and network addresses, Google's STUN server helps find a route, and a PeerJS relay server may forward the encrypted data if a direct path fails. The other person can see your IP address.

Rules & Limitations

  • Two people per session. Anyone else who opens the link is turned away while two are connected.
  • Only JavaScript runs. It runs in your own browser in an isolated sandbox with no access to this site's data, and it is stopped after 5 seconds. Python, Java, C++ and the rest are highlighted but not run.
  • The code isn't saved anywhere. Copy or download it before you close the tab.
  • Documents up to 500,000 characters. If you both edit the same spot at the same moment, both changes are kept side by side.
  • Office, college and some public Wi-Fi networks block peer-to-peer (WebRTC) connections; mobile data usually works.

Top Suggestions

  • Pair programming with a classmate or colleague without installing anything
  • Walking someone through a bug while you both look at the same code
  • Practising coding interview questions with a friend
  • Reviewing a short snippet together on a video call

P2P Code Share FAQ

How do I share code live with someone?

Click Start session, then send the link (or let them scan the QR code). When they open it, you are connected and both of you can type in the same editor. Keep both tabs open until you are done.

Is my code uploaded to a server?

No. Code, output and video go directly between the two browsers over an encrypted peer-to-peer (WebRTC) connection. The public PeerJS server only introduces the two browsers, and a relay server may forward the encrypted data if a direct path fails.

Can the other person see my IP address?

Yes. Peer-to-peer connections work by exchanging network addresses, so each side can see the other's IP address. Only share the link with people you trust.

Is it safe to run code the other person wrote?

JavaScript runs in a sandboxed worker with a separate, empty origin: it can't read your cookies, saved data or this page, and it is stopped after 5 seconds. It can still use your processor and make network requests like any web page, so run only code you understand. Your output is shared only when you click Share output.

Why can't we connect on our office or college Wi-Fi?

Many managed networks block the traffic that peer-to-peer connections need. Try again with one or both devices on mobile data or a home network. The tool tells you when the connection server can't be reached or the direct connection fails.

Can more than two people join?

No. A session is for two people. Anyone else who opens the link is told the session is full.