diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
index 9eabb6d..dfdf817 100644
--- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py
@@ -9,7 +9,7 @@ from pprint import pformat
from django.template.base import Variable, Library
from django.conf import settings
-from django.utils import formats
+from django.utils import formats, simplejson
from django.utils.dateformat import format, time_format
from django.utils.encoding import force_unicode, iri_to_uri
from django.utils.html import (conditional_escape, escapejs, fix_ampersands,
@@ -832,6 +832,21 @@ def filesizeformat(bytes):
return ugettext("%s TB") % filesize_number_format(bytes / (1024 * 1024 * 1024 * 1024))
return ugettext("%s PB") % filesize_number_format(bytes / (1024 * 1024 * 1024 * 1024 * 1024))
+@register.filter(is_safe=True)
+def json(value):
+ """
+ Returns the json representation of value.
+
+ This filter is most often used within
+
+If ``value`` is the python dictionary with nested list
+``{'hello': ['world', 'wide']}``, the output will be the string
+``'{"hello": ["world", "wide"]}'``.
+
+This filter is most often used within ``