Question: > 
> **Possible Duplicate:**  
> 
> [How to convert ArcGIS Server JSON to GeoJSON?](https://gis.stackexchange.com/questions/13029/how-to-convert-arcgis-server-json-to-geojson) 
> 
> 
> 

How to convert ArcGIS Javascript api Geometry Object to GeoJson using Javascript?

Answer: 
You can do it client-side in JavaScript. You can check the source out here.
<https://github.com/odoe/esritogeo>

And I've started implementing the same thing in python, but in both directions.
<https://github.com/odoe/SpatialJSON>

Here is a sample where you can use JavaScript to convert the results of an Esri map service query to GeoJSON to use in Leaflet
<https://gist.github.com/2424223>
The geometry object has a method, toJson(), that will do this for you:
[Javascript API Reference](http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi_start.htm)