diff --git a/pretty.go b/pretty.go
index <HASH>..<HASH> 100644
--- a/pretty.go
+++ b/pretty.go
@@ -1,9 +1,10 @@
 /*
  Pretty-print Go data structures
- */
+*/
 package pretty
 
 import (
+	"bytes"
 	"io"
 	"os"
 	r "reflect"
@@ -31,6 +32,13 @@ func PrettyPrint(i interface{}) {
 	PrettyPrintTo(os.Stdout, i)
 }
 
+// pretty print the input value (to string)
+func PrettyFormat(i interface{}) string {
+	var out bytes.Buffer
+	PrettyPrintTo(&out, i)
+	return out.String()
+}
+
 // pretty print the input value (to specified writer)
 func PrettyPrintTo(out io.Writer, i interface{}) {
 	p := &Pretty{DEFAULT_INDENT, out, DEFAULT_NIL}
Added PrettyFormat (format data structure and return it as a string)