Take the 2-minute tour ×

Does anyone know for a tool that allows a c executable to be run in the browser? I'm looking for a javascript, java, or flash solution because I don't have privileges to run c executables on the server.

The executables are basic input and output programs.

share|improve this question
This kind of thing doesn't exist for obvious security reasons. –  minitech May 18 '11 at 23:57
write a java wrapper to call it and display its outputs? exampledepot.com/egs/java.lang/Exec.html –  Chris May 18 '11 at 23:58
I know the most obvious solution is to rewrite the programs in a scripting language, but that won't work for this. I have students that want to show off their c executables on a webpage. –  QuinnBaetz May 18 '11 at 23:58
I see how there are obvious security reasons if you are running an executable on someones machine, but in the browser, or a jvm? –  QuinnBaetz May 19 '11 at 0:00
Even if there was a way of "running an executable" in a browser or jvm, it would still be running on the client machine, which is absolutely ridiculous considering the fact that you're going to run into some very basic problems such as processor architecture and platform dependence for the c executable. Just write some script in something like php that invokes the c program server-side and returns the output... and I don't understand how you don't have "privileges to run a c executable" unless you don't have access to the machine at all... –  photoionized May 19 '11 at 0:19

3 Answers 3

up vote 1 down vote accepted

Looking at your comments, I hear you mention students and running simple programs. As a suggestion, you might want to look into CodePad. This will let you interpret simple C programs. Note that everything needs to be in one place, so you'll have to combine C and header files.

Here is a sample:



Here's another one I found:


When you run the program, at the bottom there is a link for input. You can use it to run the program with given input as entered.

share|improve this answer
That's close, but it doesn't allow for user input, just output. THANKS! –  QuinnBaetz May 19 '11 at 0:29
@QuinnBaetz I just added another solution like Codepad, but it allows you to enter input after first compilation at run by the controls at the bottom. –  onteria_ May 19 '11 at 0:43
This isn't quite what I was looking for because it requires all of the input to be given at the beginning, but I think it's the closest I'm going to get. –  QuinnBaetz May 19 '11 at 2:48

You could use this as a basis for solving the problem:


share|improve this answer


Using Emscripten, you can

  • Compile C and C++ code into JavaScript and run that on the web
  • Run code in languages like Python as well, by compiling CPython from C to JavaScript and interpreting code in that on the web
share|improve this answer

Your Answer


