Skip to main content
+

Simple String

RESP2

prefix: +  ·  client type: String / str in most languages

Simple strings are non-binary-safe strings terminated by CRLF. The + prefix signals a single-line string that cannot contain \r or \n characters. Used for short server replies like +OK, +PONG, and +QUEUED. For binary-safe string data, use bulk strings ($).

Details

Simple strings use the format +<string>\r\n. They are efficient for short status replies because they do not require a length prefix – the CRLF terminator marks the end.

Because simple strings cannot contain \r or \n, they are not suitable for arbitrary data. For binary data, Redis uses bulk strings ($) which include an explicit length prefix.

Common simple string replies: +OK – successful write operation (SET, HSET, etc.) +PONG – response to PING command +QUEUED – command queued in a MULTI/EXEC transaction +NONE – some commands return +NONE for no-result

Note: in RESP3, simple strings remain valid. The server may return simple strings or blob strings depending on the command and context.

Wire encoding

Wire bytes (CRLF shown as \\r\\n)
+OK\r\n
+PONG\r\n
+QUEUED\r\n

Type information

Prefix byte+
VersionRESP2
Client typeString / str in most languages
SpecificationRESP3 specification (GitHub) →

Redis commands returning this type

SETPINGSELECTBGSAVE

See Also