Skip to main content
Open in Replit

Clicking this badge automatically opens Replit and populates the prompt and settings.

To build a link, use the format below.
https://replit.com/?stack=Build&prompt=A4Jw9gtsAuQ&referrer=replit-docs

URL parameters

Make sure to include the following parameters in your URL.
ParameterTypeDescriptionRequired/Optional
stackstringThe build mode to use. Must be either Design or Build. Design opens Design Mode for visual prototyping. Build opens Agent for full app development.Required
promptstringText describing the application to build, compressed using LZ-string. The uncompressed prompt can be up to 50,000 characters.Required
referrerstringThe name or URL of the page containing this link. Used for attribution.Optional
The prompt parameter must be compressed using LZ-string compression before being added to the URL. This helps URLs remain within browser length limits and parse correctly.
Use the tool below to generate your Open in Replit link. Enter your prompt, select the stack mode, and the link will be generated automatically with LZ-string compression applied.
The name or URL of the page containing this link. Used for attribution.
https://replit.com/?stack=Design&prompt=
Open in Replit badge
[![Open in Replit](https://replit.com/badge?caption=Open%20in%20Replit)](https://replit.com/?stack=Design&prompt=)

Compressing prompts

To create a valid Open in Replit link, you must compress your prompt using LZ-string compression. Here’s how:

JavaScript/TypeScript

import LZString from 'lz-string';

const prompt = 'Create a todo app with a clean, modern design';
const compressed = LZString.compressToEncodedURIComponent(prompt);
const url = `https://replit.com/?stack=Design&prompt=${compressed}`;

Python

import lzstring

prompt = "Create a todo app with a clean, modern design"
compressed = lzstring.LZString().compressToEncodedURIComponent(prompt)
url = f"https://replit.com/?stack=Design&prompt={compressed}"
Use compressToEncodedURIComponent to ensure the compressed string is URL-safe.

Examples

Design Mode with basic prompt
https://replit.com/?stack=Design&prompt=AoUwTgzg9gdghgGwAQAcpgC4DMoIJZRIR4YgB0QA
Build Mode with detailed prompt
https://replit.com/?stack=Build&prompt=LIQw1gpgBCUE4HsQBMC2IAOUMBsQDt8BLfAcygBcEEcoB3ACwjmg0WQFcBjCqdfEKWYBnKFwJiWICtALIoANyLCOIHEQBe0AI6q4MuDgCe2dt16IU6DMIB0UAJL4uODsmjI4g0iABGOaHE4ZFEAMwQ4KBIiCiJpIgUIYQAaUyIImJMKQRSYfHkuGgixBGQScl8siBBUewARJKJSfCjeOhiGGFMEUKThdIFaWNQIdXxoJQg6PIKAglTUUuYWgFUHWyA&referrer=replit%20docs

Stack modes

Design Mode

Use stack=Design to open your prompt in Design Mode, which is optimized for:
  • Visual design and UI prototyping
  • Rapid iteration on layouts and styling
  • Creating design mockups
  • Frontend-focused development

Build Mode

Use stack=Build to open your prompt in Agent, which is optimized for:
  • Full-stack application development
  • Backend logic and APIs
  • Database integration
  • Complex functionality and features

Best practices

  • Keep prompts concise and focused on core features for best generation results.
  • Use clear, descriptive language that explains what you want to build.
  • Choose the appropriate stack mode for your use case (Design for UI/UX, Build for full apps).
  • Test your compressed URLs to ensure they parse correctly before sharing.
  • Consider your audience’s technical level when crafting prompts.

User authentication

Regardless of your Replit authentication state, you’ll need to provide input before creating the app. Usually this means submitting the prompt.

Error handling

If the URL is malformed or parameters are invalid, Replit won’t fill the prompt. Possible causes include:
  • Missing required parameters (stack or prompt)
  • Invalid stack value (must be Design or Build)
  • Failed decompression of the prompt parameter
  • Browser “URL too long” errors (though compression helps mitigate this)

Security considerations

Open in Replit links could be used to create apps with unintended behavior or security vulnerabilities. Only click links from trusted sources.
When sharing Open in Replit links:
  • Review prompts carefully before sharing publicly
  • Consider the security implications of the apps being generated
  • Avoid including sensitive information in prompts
  • Be transparent about what the link will create